Index: test/mjsunit/compiler/regress-shared-deopt.js |
diff --git a/test/mjsunit/regress/regress-seqstrsetchar-ex3.js b/test/mjsunit/compiler/regress-shared-deopt.js |
similarity index 77% |
copy from test/mjsunit/regress/regress-seqstrsetchar-ex3.js |
copy to test/mjsunit/compiler/regress-shared-deopt.js |
index e2592a1615aa6bcfbbaa688319b8a0f6d34aa4a7..669e0e2f1de385214c3033b01924cc55d15e55e7 100644 |
--- a/test/mjsunit/regress/regress-seqstrsetchar-ex3.js |
+++ b/test/mjsunit/compiler/regress-shared-deopt.js |
@@ -27,19 +27,39 @@ |
// Flags: --allow-natives-syntax |
+var soft = false; |
+ |
+// disable optimization of this global |
+soft = true; |
+soft = false; |
+soft = true; |
+soft = false; |
+ |
function test() { |
- var string = %NewString(10, true); |
- for (var i = 0; i < 10; i++) { |
- %_OneByteSeqStringSetChar(string, i, 65); |
- %_OneByteSeqStringSetChar(string, i, 66); |
- } |
- for (var i = 0; i < 10; i++) { |
- assertEquals("B", string[i]); |
+ var f4 = makeF(4); |
+ var f5 = makeF(5); |
+ |
+ function makeF(i) { |
+ return function f(x) { |
+ if (x == 0) return i; |
+ if (i == 4) if (soft) print("wahoo" + i); |
+ return f4(x - 1); |
+ } |
} |
+ |
+ f4(9); |
+ f4(11); |
+ %OptimizeFunctionOnNextCall(f4); |
+ f4(12); |
+ |
+ f5(9); |
+ f5(11); |
+ %OptimizeFunctionOnNextCall(f5); |
+ f5(12); |
+ |
+ soft = true; |
+ f4(1); |
+ f5(9); |
} |
test(); |
-test(); |
-%OptimizeFunctionOnNextCall(test); |
-test(); |
- |