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); |