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

Unified Diff: test/mjsunit/never-optimize.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/mjsunit.js ('k') | test/mjsunit/regress/regress-2618.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/never-optimize.js
diff --git a/test/mjsunit/never-optimize.js b/test/mjsunit/never-optimize.js
index f674808d7ab1e90745ab1d588d512fa2381479da..643588ebf41e84c5d42bef8829d9ceb1e756841c 100644
--- a/test/mjsunit/never-optimize.js
+++ b/test/mjsunit/never-optimize.js
@@ -30,30 +30,34 @@
function o1() {
}
-o1(); o1();
-%OptimizeFunctionOnNextCall(o1);
-o1();
+if (%GetOptimizationStatus(o1) != 4) {
+ // 4 == optimization disabled.
+ o1(); o1();
+ %OptimizeFunctionOnNextCall(o1);
+ o1();
-// Check that the given function was optimized.
-assertOptimized(o1);
+ // Check that the given function was optimized.
+ assertOptimized(o1);
-// Test the %NeverOptimizeFunction runtime call.
-%NeverOptimizeFunction(u1);
-function u1() {
+ // Test the %NeverOptimizeFunction runtime call.
+ %NeverOptimizeFunction(u1);
+ function u1() {
+ }
+
+ function u2() {
+ u1();
+ }
+
+ u1(); u1();
+ u2(); u2();
+
+ %OptimizeFunctionOnNextCall(u1);
+ %OptimizeFunctionOnNextCall(u2);
+
+ u1(); u1();
+ u2(); u2();
+
+ // 2 => not optimized.
+ assertUnoptimized(u1);
+ assertOptimized(u2);
}
-
-function u2() {
- u1();
-}
-
-u1(); u1();
-u2(); u2();
-
-%OptimizeFunctionOnNextCall(u1);
-%OptimizeFunctionOnNextCall(u2);
-
-u1(); u1();
-u2(); u2();
-
-assertUnoptimized(u1);
-assertOptimized(u2);
« no previous file with comments | « test/mjsunit/mjsunit.js ('k') | test/mjsunit/regress/regress-2618.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698