Index: test/mjsunit/regress/regress-freeze.js |
diff --git a/test/mjsunit/regress/regress-crbug-242870.js b/test/mjsunit/regress/regress-freeze.js |
similarity index 87% |
copy from test/mjsunit/regress/regress-crbug-242870.js |
copy to test/mjsunit/regress/regress-freeze.js |
index 7183375ca811cedc81c870d34e694e98cf727f9b..6f3de2a4c98e532e7bcf530e893f2eadbbe96066 100644 |
--- a/test/mjsunit/regress/regress-crbug-242870.js |
+++ b/test/mjsunit/regress/regress-freeze.js |
@@ -27,17 +27,20 @@ |
// Flags: --allow-natives-syntax |
-var non_const_true = true; |
- |
-function f() { |
- return (non_const_true || true && g()); |
-} |
- |
-function g() { |
- for (;;) {} |
-} |
- |
-assertTrue(f()); |
-assertTrue(f()); |
+// CountOperation |
+function f(o) { o.x++ }; |
+var o = {x: 5}; |
+Object.freeze(o); |
+f(o); |
+f(o); |
%OptimizeFunctionOnNextCall(f); |
-assertTrue(f()); |
+f(o); |
+assertEquals(5, o.x); |
+ |
+// Compound Assignment |
+function f2(o) { o.x+=3 }; |
+f2(o); |
+f2(o); |
+%OptimizeFunctionOnNextCall(f2); |
+f2(o); |
+assertEquals(5, o.x); |