Index: test/mjsunit/deopt-minus-zero.js |
diff --git a/test/mjsunit/regress/regress-inlining-function-literal-context.js b/test/mjsunit/deopt-minus-zero.js |
similarity index 76% |
copy from test/mjsunit/regress/regress-inlining-function-literal-context.js |
copy to test/mjsunit/deopt-minus-zero.js |
index 9b7f7ac76882f09e1cc837373c1bee547c645de3..ee0983127dc3ae10311cf11a88ba40284e366dfe 100644 |
--- a/test/mjsunit/regress/regress-inlining-function-literal-context.js |
+++ b/test/mjsunit/deopt-minus-zero.js |
@@ -27,27 +27,30 @@ |
// Flags: --allow-natives-syntax --expose-gc |
-function mkbaz(x) { |
- function baz() { |
- return function () { |
- return [x]; |
- } |
- } |
- return baz; |
-} |
- |
-var baz = mkbaz(1); |
+/** |
+ * The possible optimization states of a function. Must be in sync with the |
+ * return values of Runtime_GetOptimizationStatus() in runtime.cc! |
+ */ |
+var OptimizationState = { |
+ YES: 1, |
+ NO: 2, |
+ ALWAYS: 3, |
+ NEVER: 4 |
+}; |
-function foo() { |
- var f = baz(); |
- return f(); |
+function mul (a, b) { |
+ return a * b; |
} |
-// Tenure. |
-gc(); |
+mul(-1, -1); |
+mul(0x80000001|0, -1); |
+mul(0x80000001|0, -1); |
+%OptimizeFunctionOnNextCall(mul); |
+mul(0, -1); |
+%OptimizeFunctionOnNextCall(mul); |
+mul(0, -1); |
+ |
+var raw_optimized = %GetOptimizationStatus(mul); |
+assertFalse(raw_optimized == OptimizationState.NO); |
gc(); |
-assertArrayEquals([1], foo()); |
-assertArrayEquals([1], foo()); |
-%OptimizeFunctionOnNextCall(foo); |
-assertArrayEquals([1], foo()); |