| Index: test/mjsunit/regress/regress-2250.js
|
| diff --git a/test/mjsunit/regress/regress-2110.js b/test/mjsunit/regress/regress-2250.js
|
| similarity index 62%
|
| copy from test/mjsunit/regress/regress-2110.js
|
| copy to test/mjsunit/regress/regress-2250.js
|
| index d7f78d26a7b4d16c4217d2b0ac136e52e4542eb1..b3b0db3fc386fdd469f580f57dcc77bd40a5f930 100644
|
| --- a/test/mjsunit/regress/regress-2110.js
|
| +++ b/test/mjsunit/regress/regress-2250.js
|
| @@ -27,27 +27,42 @@
|
|
|
| // Flags: --allow-natives-syntax
|
|
|
| -var uint8 = new Uint8Array(1);
|
| +// The original problem from the bug: In the example below SMI check for b
|
| +// generated for inlining of equals invocation (marked with (*)) will be hoisted
|
| +// out of the loop across the typeof b === "object" condition and cause an
|
| +// immediate deopt. Another problem here is that no matter how many time we
|
| +// deopt and reopt we will continue to produce the wrong code.
|
| +//
|
| +// The fix is to notice when a deopt and subsequent reopt doesn't find
|
| +// additional type information, indicating that optimistic LICM should be
|
| +// disabled during compilation.
|
| +
|
| +function eq(a, b) {
|
| + if (typeof b === "object") {
|
| + return b.equals(a); // (*)
|
| + }
|
| + return a === b;
|
| +}
|
| +
|
| +Object.prototype.equals = function (other) {
|
| + return (this === other);
|
| +};
|
|
|
| function test() {
|
| - uint8[0] = 0x800000aa;
|
| - assertEquals(0xaa, uint8[0]);
|
| + for (var i = 0; !eq(i, 10); i++)
|
| + ;
|
| }
|
|
|
| +eq({}, {});
|
| +eq({}, {});
|
| +eq(1, 1);
|
| +eq(1, 1);
|
| test();
|
| -test();
|
| +%OptimizeFunctionOnNextCall(test);
|
| test();
|
| %OptimizeFunctionOnNextCall(test);
|
| +// Second compilation should have noticed that LICM wasn't a good idea, and now
|
| +// function should no longer deopt when called.
|
| test();
|
| +assertTrue(2 != %GetOptimizationStatus(test));
|
|
|
| -var uint32 = new Uint32Array(1);
|
| -
|
| -function test2() {
|
| - uint32[0] = 0x80123456789abcde;
|
| - assertEquals(0x789ac000, uint32[0]);
|
| -}
|
| -
|
| -test2();
|
| -test2();
|
| -%OptimizeFunctionOnNextCall(test2);
|
| -test2();
|
|
|