| Index: test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| diff --git a/test/mjsunit/regress/regress-crbug-336148.js b/test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| similarity index 70%
|
| copy from test/mjsunit/regress/regress-crbug-336148.js
|
| copy to test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| index 8157c9fcc1978c632a32f1930af56cf113276bcc..fb7280a0d1128c6baad81e759aad6b6bec3c6528 100644
|
| --- a/test/mjsunit/regress/regress-crbug-336148.js
|
| +++ b/test/mjsunit/regress/binop-in-effect-context-deopt.js
|
| @@ -27,30 +27,39 @@
|
|
|
| // Flags: --allow-natives-syntax
|
|
|
| -function f(o) {
|
| - var a = 1;
|
| - if (true) return o.v && a;
|
| -}
|
| -
|
| -f({});
|
| -f({});
|
| -%OptimizeFunctionOnNextCall(f);
|
| -assertEquals(1, f({ v: 1 }));
|
| -
|
| -
|
| -function f1() { return 1 && 2; };
|
| -function f2() { return 1 || 2; };
|
| -function f3() { return 0 && 2; };
|
| -function f4() { return 0 || 2; };
|
| -
|
| -function test() {
|
| - assertEquals(2, f1());
|
| - assertEquals(1, f2());
|
| - assertEquals(0, f3());
|
| - assertEquals(2, f4());
|
| -}
|
| -
|
| -test();
|
| -test();
|
| -[f1, f2, f3, f4].forEach(function(f) { %OptimizeFunctionOnNextCall(f); });
|
| -test();
|
| +(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();
|
| +})();
|
|
|