Chromium Code Reviews| Index: test/mjsunit/compiler/regress-5320.js |
| diff --git a/test/mjsunit/compiler/deopt-materialize-accumulator.js b/test/mjsunit/compiler/regress-5320.js |
| similarity index 70% |
| copy from test/mjsunit/compiler/deopt-materialize-accumulator.js |
| copy to test/mjsunit/compiler/regress-5320.js |
| index 0b19df8a1cf03fef0e94a92d7408d2a7dece0796..8f98bd3be8ae1d9e8bf40c629c26d120dae0732e 100644 |
| --- a/test/mjsunit/compiler/deopt-materialize-accumulator.js |
| +++ b/test/mjsunit/compiler/regress-5320.js |
| @@ -26,16 +26,27 @@ |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| // Flags: --allow-natives-syntax |
| -// |
| -// Tests that Turbofan correctly materializes values which are in the |
| -// interpreters accumulator during deopt. |
| -var global = 3; |
| -function f(a) { |
| - // This will trigger a deopt since global was previously a SMI, with the |
| - // accumulator holding an unboxed double which needs materialized. |
| - global = Math.sqrt(a); |
| +function OptimizeTruncatingBinaryOp(func) { |
| + func(42, -2); |
| + func(31, undefined); |
| + %BaselineFunctionOnNextCall(func); |
| + func(42, -2); |
| + func(31, undefined); |
| + % OptimizeFunctionOnNextCall(func); |
|
Jarin
2016/08/30 13:05:52
Remove space.
epertoso
2016/08/30 13:46:48
Done.
|
| + func(-1, 2.1); |
| + assertOptimized(func); |
| } |
| -%OptimizeFunctionOnNextCall(f); |
| -f(0.25); |
| -assertEquals(0.5, global); |
| + |
| +// SAR |
| +OptimizeTruncatingBinaryOp(function(a, b) { return a >> b; }); |
| +// SHR |
| +OptimizeTruncatingBinaryOp(function(a, b) { return a >>> b; }); |
| +// SHL |
| +OptimizeTruncatingBinaryOp(function(a, b) { return a << b; }); |
| +// BIT_AND |
| +OptimizeTruncatingBinaryOp(function(a, b) { return a & b; }); |
| +// BIT_OR |
| +OptimizeTruncatingBinaryOp(function(a, b) { return a | b; }); |
| +// BIT_XOR |
| +OptimizeTruncatingBinaryOp(function(a, b) { return a ^ b; }); |