| Index: test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| diff --git a/test/mjsunit/regress/regress-331416.js b/test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| similarity index 69%
|
| copy from test/mjsunit/regress/regress-331416.js
|
| copy to test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| index 0c60fced14e1c185919985fd011c9ca46d93ff3f..fb7280a0d1128c6baad81e759aad6b6bec3c6528 100644
|
| --- a/test/mjsunit/regress/regress-331416.js
|
| +++ b/test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| @@ -27,26 +27,39 @@
|
|
|
| // Flags: --allow-natives-syntax
|
|
|
| -function load(a, i) {
|
| - return a[i];
|
| -}
|
| -load([1, 2, 3], "length");
|
| -load(3);
|
| -load([1, 2, 3], 3);
|
| -load(0, 0);
|
| -%OptimizeFunctionOnNextCall(load);
|
| -assertEquals(2, load([1, 2, 3], 1));
|
| -assertEquals(undefined, load(0, 0));
|
| -
|
| -function store(a, i, x) {
|
| - a[i] = x;
|
| -}
|
| -store([1, 2, 3], "length", 3);
|
| -store(3);
|
| -store([1, 2, 3], 3, 3);
|
| -store(0, 0, 1);
|
| -%OptimizeFunctionOnNextCall(store);
|
| -var a = [1, 2, 3];
|
| -store(a, 1, 1);
|
| -assertEquals(1, a[1]);
|
| -store(0, 0, 1);
|
| +(function BinopInEffectContextDeoptAndOsr() {
|
| + function f(a, deopt, osr) {
|
| + var result = (a + 10, "result");
|
| + var dummy = deopt + 0;
|
| + if (osr) while (%GetOptimizationStatus(f) == 2) {}
|
| + return result;
|
| + }
|
| +
|
| + 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();
|
| +})();
|
|
|