Index: test/mjsunit/shared-function-tier-up-default.js |
diff --git a/test/mjsunit/shared-function-tier-up-default.js b/test/mjsunit/shared-function-tier-up-default.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fe1d0907968c5ca450a289efa672d0167321098d |
--- /dev/null |
+++ b/test/mjsunit/shared-function-tier-up-default.js |
@@ -0,0 +1,24 @@ |
+// Copyright 2016 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+// |
+// Flags: --mark-shared-functions-for-tier-up --allow-natives-syntax --no-ignition-staging --no-turbo |
rmcilroy
2016/11/07 10:17:46
This is not really default since it's --no-ignitio
Leszek Swirski
2016/11/11 10:13:29
I tried putting this in a single test, but it ende
|
+ |
+(function f() { |
+ var sum = 0; |
+ var i = 0; |
+ for (var i = 0; i < 3; ++i) { |
+ var g = function(x) { |
+ return 2 * x; |
+ } |
+ sum += g(i); |
+ |
+ if (i == 1) { |
+ // Run twice (i = 0, 1), then tier-up. |
+ %OptimizeFunctionOnNextCall(g); |
+ } else if (i == 2) { |
+ // Tier-up at i = 2 should go up to crankshaft. |
+ assertEquals(1, %GetOptimizationStatus(g)); |
+ } |
+ } |
+})() |