| Index: test/mjsunit/assert-opt-and-deopt.js
|
| ===================================================================
|
| --- test/mjsunit/assert-opt-and-deopt.js (revision 10399)
|
| +++ test/mjsunit/assert-opt-and-deopt.js (working copy)
|
| @@ -34,7 +34,7 @@
|
| * the --allow-natives-syntax flag so far.
|
| */
|
| function OptTracker() {
|
| - this.opt_counts_ = {};
|
| + this.deopt_counts_ = {};
|
| }
|
|
|
| /**
|
| @@ -55,8 +55,8 @@
|
| * tests are sometimes executed several times in a row, and you want to
|
| * disregard counts from previous runs.
|
| */
|
| -OptTracker.prototype.CheckpointOptCount = function(func) {
|
| - this.opt_counts_[func] = %GetOptimizationCount(func);
|
| +OptTracker.prototype.CheckpointDeoptCount = function(func) {
|
| + this.deopt_counts_[func] = %GetDeoptimizationCount(func);
|
| };
|
|
|
| OptTracker.prototype.AssertOptCount = function(func, optcount) {
|
| @@ -100,23 +100,24 @@
|
| * @private
|
| */
|
| OptTracker.prototype.GetOptCount_ = function(func) {
|
| - var raw_count = %GetOptimizationCount(func);
|
| - if (func in this.opt_counts_) {
|
| - var checkpointed_count = this.opt_counts_[func];
|
| - return raw_count - checkpointed_count;
|
| + var count = this.GetDeoptCount_(func);
|
| + if (%GetOptimizationStatus(func) == OptTracker.OptimizationState.YES) {
|
| + count += 1;
|
| }
|
| - return raw_count;
|
| + return count;
|
| }
|
|
|
| +
|
| /**
|
| * @private
|
| */
|
| OptTracker.prototype.GetDeoptCount_ = function(func) {
|
| - var count = this.GetOptCount_(func);
|
| - if (%GetOptimizationStatus(func) == OptTracker.OptimizationState.YES) {
|
| - count -= 1;
|
| + var raw_count = %GetDeoptimizationCount(func);
|
| + if (func in this.deopt_counts_) {
|
| + var checkpointed_count = this.deopt_counts_[func];
|
| + return raw_count - checkpointed_count;
|
| }
|
| - return count;
|
| + return raw_count;
|
| }
|
|
|
| /**
|
| @@ -141,7 +142,7 @@
|
| }
|
|
|
| var tracker = new OptTracker();
|
| -tracker.CheckpointOptCount(f);
|
| +tracker.CheckpointDeoptCount(f);
|
|
|
| tracker.AssertOptCount(f, 0);
|
| tracker.AssertIsOptimized(f, false);
|
|
|