Chromium Code Reviews

Unified Diff: test/mjsunit/shared-function-tier-up-default.js

Issue 2478323002: [compiler] Fix flipped boolean checks in marked tier-up (Closed)
Patch Set: Add some regression tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/shared-function-tier-up-ignition.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
+ }
+ }
+})()
« no previous file with comments | « src/compiler.cc ('k') | test/mjsunit/shared-function-tier-up-ignition.js » ('j') | no next file with comments »

Powered by Google App Engine