| Index: test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| diff --git a/test/mjsunit/compiler/alloc-number-debug.js b/test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| similarity index 70%
|
| copy from test/mjsunit/compiler/alloc-number-debug.js
|
| copy to test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| index ccfcc0c185a6d29c0acfc3c217276434b71f130a..fb7280a0d1128c6baad81e759aad6b6bec3c6528 100644
|
| --- a/test/mjsunit/compiler/alloc-number-debug.js
|
| +++ b/test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| @@ -27,18 +27,39 @@
|
|
|
| // Flags: --allow-natives-syntax
|
|
|
| -// Try to get a GC because of a heap number allocation while we
|
| -// have live values (o) in a register.
|
| -function f(o) {
|
| - var x = 1.5;
|
| - var y = 2.5;
|
| - for (var i = 1; i < 3; i += 1) {
|
| - %SetAllocationTimeout(1, 0, false);
|
| - o.val = x + y + i;
|
| - %SetAllocationTimeout(-1, -1, true);
|
| +(function BinopInEffectContextDeoptAndOsr() {
|
| + function f(a, deopt, osr) {
|
| + var result = (a + 10, "result");
|
| + var dummy = deopt + 0;
|
| + if (osr) while (%GetOptimizationStatus(f) == 2) {}
|
| + return result;
|
| }
|
| - return o;
|
| -}
|
|
|
| -var o = { val: 0 };
|
| -f(o);
|
| + assertEquals("result", f(true, 3, false));
|
| + assertEquals("result", f(true, 3, false));
|
| + %OptimizeFunctionOnNextCall(f);
|
| + assertEquals("result", f(true, "foo", true));
|
| +})();
|
| +
|
| +
|
| +(function BinopInEffectContextLazyDeopt() {
|
| + function deopt_f() {
|
| + %DeoptimizeFunction(f);
|
| + return "dummy";
|
| + }
|
| +
|
| + function h() {
|
| + return { toString : deopt_f };
|
| + }
|
| +
|
| + function g(x) {
|
| + }
|
| +
|
| + function f() {
|
| + return g(void(h() + ""));
|
| + };
|
| +
|
| + f();
|
| + %OptimizeFunctionOnNextCall(f);
|
| + f();
|
| +})();
|
|
|