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

Unified Diff: test/mjsunit/ensure-growing-store-learns.js

Issue 2655223003: Revert of [tests] Make assertOptimized()/assertUnoptimized() great again. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/deopt-with-fp-regs.js ('k') | test/mjsunit/es6/array-iterator-turbo.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/ensure-growing-store-learns.js
diff --git a/test/mjsunit/ensure-growing-store-learns.js b/test/mjsunit/ensure-growing-store-learns.js
index 1b7c21a4a8ecaf39f7301a65222c4d7586f4ece6..e64fe9392187088c594cccdb4a64f581d046fbe5 100644
--- a/test/mjsunit/ensure-growing-store-learns.js
+++ b/test/mjsunit/ensure-growing-store-learns.js
@@ -2,18 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --allow-natives-syntax --noverify-heap --noenable-slow-asserts
-// Flags: --no-always-opt --crankshaft
+ // Flags: --allow-natives-syntax --noverify-heap --noenable-slow-asserts
-// --noverify-heap and --noenable-slow-asserts are set because the test is too
-// slow with it on.
+ // --noverify-heap and --noenable-slow-asserts are set because the test is too
+ // slow with it on.
-assertFalse(isNeverOptimize());
-assertFalse(isAlwaysOptimize());
-
-// Ensure that keyed stores work, and optimized functions learn if the
-// store required change to dictionary mode. Verify that stores that grow
-// the array into large object space don't cause a deopt.
+ // Ensure that keyed stores work, and optimized functions learn if the
+ // store required change to dictionary mode. Verify that stores that grow
+ // the array into large object space don't cause a deopt.
(function() {
var a = [];
@@ -64,24 +60,27 @@
%OptimizeFunctionOnNextCall(foo2);
foo2(a, 40);
- assertOptimized(foo2);
- assertTrue(%HasFastSmiElements(a));
+ // This test is way too slow without crankshaft.
+ if (4 != %GetOptimizationStatus(foo2)) {
+ assertOptimized(foo2);
+ assertTrue(%HasFastSmiElements(a));
- // Grow a large array into large object space through the keyed store
- // without deoptimizing. Grow by 10s. If we set elements too sparsely, the
- // array will convert to dictionary mode.
- a = new Array(99999);
- assertTrue(%HasFastSmiElements(a));
- for (var i = 0; i < 263000; i += 10) {
- foo2(a, i);
+ // Grow a large array into large object space through the keyed store
+ // without deoptimizing. Grow by 10s. If we set elements too sparsely, the
+ // array will convert to dictionary mode.
+ a = new Array(99999);
+ assertTrue(%HasFastSmiElements(a));
+ for (var i = 0; i < 263000; i += 10) {
+ foo2(a, i);
+ }
+
+ // Verify that we are over 1 page in size, and foo2 remains optimized.
+ // This means we've smoothly transitioned to allocating in large object
+ // space.
+ assertTrue(%HasFastSmiElements(a));
+ assertTrue(a.length * 4 > (1024 * 1024));
+ assertOptimized(foo2);
}
-
- // Verify that we are over 1 page in size, and foo2 remains optimized.
- // This means we've smoothly transitioned to allocating in large object
- // space.
- assertTrue(%HasFastSmiElements(a));
- assertTrue(a.length * 4 > (1024 * 1024));
- assertOptimized(foo2);
%ClearFunctionTypeFeedback(foo2);
})();
« no previous file with comments | « test/mjsunit/deopt-with-fp-regs.js ('k') | test/mjsunit/es6/array-iterator-turbo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698