Index: test/mjsunit/omit-constant-mapcheck.js |
diff --git a/test/mjsunit/regress/regress-int32-truncation.js b/test/mjsunit/omit-constant-mapcheck.js |
similarity index 79% |
copy from test/mjsunit/regress/regress-int32-truncation.js |
copy to test/mjsunit/omit-constant-mapcheck.js |
index dec4ac1195a6c4928d84eac8cc8dc9496bf66600..6894275db714875bedd6790036d4ada02812425e 100644 |
--- a/test/mjsunit/regress/regress-int32-truncation.js |
+++ b/test/mjsunit/omit-constant-mapcheck.js |
@@ -27,35 +27,29 @@ |
// Flags: --allow-natives-syntax |
-function f(i, b) { |
- var a = 0; |
- if (b) { |
- var c = 1 << i; |
- a = c + c; |
- } |
- var x = a >> 3; |
- return a; |
-} |
+var g1 = { a:1 } |
-f(1, false); |
-f(1, true); |
-%OptimizeFunctionOnNextCall(f); |
-assertEquals((1 << 30) * 2, f(30, true)); |
+function load() { |
+ return g1.a; |
+} |
+assertEquals(1, load()); |
+assertEquals(1, load()); |
+%OptimizeFunctionOnNextCall(load); |
+assertEquals(1, load()); |
+delete g1.a; |
+assertEquals(undefined, load()); |
-var global = 1; |
+var g2 = { a:2 } |
-function f2(b) { |
- var a = 0; |
- if (b) { |
- a = global; |
- } |
- var x = a >> 3; |
- return a; |
+function load2() { |
+ return g2.a; |
} |
-f2(false); |
-f2(true); |
-%OptimizeFunctionOnNextCall(f2); |
-global = 2.5; |
-assertEquals(global, f2(true)); |
+assertEquals(2, load2()); |
+assertEquals(2, load2()); |
+%OptimizeFunctionOnNextCall(load2); |
+assertEquals(2, load2()); |
+g2.b = 10; |
+g2.a = 5; |
+assertEquals(5, load2()); |