Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: test/mjsunit/shared-function-tier-up-ignition.js

Issue 2655223003: Revert of [tests] Make assertOptimized()/assertUnoptimized() great again. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Flags: --mark-shared-functions-for-tier-up --allow-natives-syntax --ignition- staging --no-turbo 5 // Flags: --mark-shared-functions-for-tier-up --allow-natives-syntax --ignition- staging --no-turbo
6 6
7 (function() { 7 (function() {
8 var sum = 0; 8 var sum = 0;
9 var i = 0; 9 var i = 0;
10 for (var i = 0; i < 5; ++i) { 10 for (var i = 0; i < 5; ++i) {
11 var f = function(x) { 11 var f = function(x) {
12 return 2 * x; 12 return 2 * x;
13 } 13 }
14 sum += f(i); 14 sum += f(i);
15 15
16 if (isAlwaysOptimize() || isNeverOptimize()) { 16 if (%GetOptimizationStatus(f) == 3 || %GetOptimizationStatus(f) == 4) {
17 // If we are always or never optimizing f, just exit, this test is useless . 17 // If we are always or never optimizing f, just exit, this test is useless .
18 return; 18 return;
19 } 19 }
20 20
21 if (i == 1) { 21 if (i == 1) {
22 // f must be interpreted code. 22 // f must be interpreted code.
23 assertTrue(isInterpreted(f)); 23 assertEquals(8, %GetOptimizationStatus(f));
24 24
25 // Allow it to run twice (i = 0, 1), then tier-up to baseline. 25 // Allow it to run twice (i = 0, 1), then tier-up to baseline.
26 %BaselineFunctionOnNextCall(f); 26 %BaselineFunctionOnNextCall(f);
27 } else if (i == 2) { 27 } else if (i == 2) {
28 // Tier-up at i = 2 should only go up to baseline. 28 // Tier-up at i = 2 should only go up to baseline.
29 assertTrue(isBaselined(f)); 29 assertEquals(2, %GetOptimizationStatus(f));
30
31 } else if (i == 3) { 30 } else if (i == 3) {
32 // Now f must be baseline code. 31 // Now f must be baseline code.
33 assertTrue(isBaselined(f)); 32 assertEquals(2, %GetOptimizationStatus(f));
34 33
35 // Run two more times (i = 2, 3), then tier-up to optimized. 34 // Run two more times (i = 2, 3), then tier-up to optimized.
36 %OptimizeFunctionOnNextCall(f); 35 %OptimizeFunctionOnNextCall(f);
37 } else if (i == 4) { 36 } else if (i == 4) {
38 // Tier-up at i = 4 should now go up to crankshaft. 37 // Tier-up at i = 4 should now go up to crankshaft.
39 assertTrue(isCrankshafted(f)); 38 assertEquals(1, %GetOptimizationStatus(f));
40 } 39 }
41 } 40 }
42 })() 41 })()
OLDNEW
« no previous file with comments | « test/mjsunit/shared-function-tier-up-default.js ('k') | test/mjsunit/shared-function-tier-up-turbo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698