Index: test/mjsunit/deopt-minus-zero.js |
diff --git a/test/mjsunit/regress/regress-cntl-descriptors-enum.js b/test/mjsunit/deopt-minus-zero.js |
similarity index 76% |
copy from test/mjsunit/regress/regress-cntl-descriptors-enum.js |
copy to test/mjsunit/deopt-minus-zero.js |
index ee72fafc8a7c67f2b1ab6cc22a734ef8033a5697..a0c1fb2c49b1a6cdf18057c22df4eda28b521a33 100644 |
--- a/test/mjsunit/regress/regress-cntl-descriptors-enum.js |
+++ b/test/mjsunit/deopt-minus-zero.js |
@@ -27,20 +27,32 @@ |
// Flags: --allow-natives-syntax --expose-gc |
-DontEnum = 2; |
- |
-var o = {}; |
-%SetProperty(o, "a", 0, DontEnum); |
- |
-var o2 = {}; |
-%SetProperty(o2, "a", 0, DontEnum); |
- |
-assertTrue(%HaveSameMap(o, o2)); |
- |
-o.y = 2; |
- |
-for (var v in o) { print(v); } |
-o = {}; |
+/** |
+ * 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 mul (a, b) { |
+ return a * b; |
Jakob Kummerow
2012/09/18 13:56:09
spaces instead of the tab, please.
|
+} |
+ |
+ |
+ |
+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); |
Jakob Kummerow
2012/09/18 13:56:09
This is the clean way to do it; in many other test
|
gc(); |
-for (var v in o2) { print(v); } |