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

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

Issue 2684033007: Allow a ParseInfo without a script for %SetCode users (Closed)
Patch Set: Some comments. 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
« src/source-position.cc ('K') | « src/source-position.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5 // Flags: --mark-shared-functions-for-tier-up --allow-natives-syntax
6 // Flags: --ignition-staging --no-turbo 6 // Flags: --ignition-staging --turbo
7 // Flags: --crankshaft --no-always-opt 7 // Flags: --crankshaft --no-always-opt
8 8
9 // If we are always or never optimizing it is useless. 9 // If we are always or never optimizing it is useless.
10 assertFalse(isAlwaysOptimize()); 10 assertFalse(isAlwaysOptimize());
11 assertFalse(isNeverOptimize()); 11 assertFalse(isNeverOptimize());
12 12
13 (function() { 13 (function() {
14 var sum = 0; 14 var sum = 0;
15 var i = 0; 15 var i = 0;
16 for (var i = 0; i < 5; ++i) { 16 for (var i = 0; i < 5; ++i) {
17 var f = function(x) { 17 var f = function(x) {
18 return 2 * x; 18 return 2 * x;
19 } 19 }
20 sum += f(i); 20 sum += f(i);
21 21
22 if (i == 1) { 22 if (i == 1) {
23 // f must be interpreted code. 23 // f must be interpreted code.
24 assertTrue(isInterpreted(f)); 24 assertTrue(isInterpreted(f));
25
26 // Allow it to run twice (i = 0, 1), then tier-up to baseline.
27 %BaselineFunctionOnNextCall(f);
28 } else if (i == 2) {
29 // Tier-up at i = 2 should only go up to baseline.
30 assertTrue(isBaselined(f));
31
32 } else if (i == 3) { 25 } else if (i == 3) {
33 // Now f must be baseline code.
34 assertTrue(isBaselined(f));
35
36 // Run two more times (i = 2, 3), then tier-up to optimized. 26 // Run two more times (i = 2, 3), then tier-up to optimized.
37 %OptimizeFunctionOnNextCall(f); 27 %OptimizeFunctionOnNextCall(f);
Leszek Swirski 2017/02/15 14:58:37 Let's move this and the below to i==1 and i==2, an
mvstanton 2017/02/15 15:18:47 Done.
38 } else if (i == 4) { 28 } else if (i == 4) {
39 // Tier-up at i = 4 should now go up to crankshaft. 29 // Tier-up at i = 4 should now go up to crankshaft.
40 assertTrue(isCrankshafted(f)); 30 assertTrue(isOptimized(f));
41 } 31 }
42 } 32 }
43 })() 33 })()
OLDNEW
« src/source-position.cc ('K') | « src/source-position.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698