v8/test/mjsunit/regress/wasm
Eric Holk ec772a4fd8 Restrict range for int64_t to immediate conversions
The included test case illustrates the problem. It subtracts (16 << 27)
from another number. The Machine Operator Reducer would replace the
shift computation with 0x0000000080000000, and then change the subtract
to an add of -(0x0000000080000000), which is 0xffffffff80000000.
The instruction selector would determine that this value could be an
immediate, because it fits in 32 bits, so it would select the lea
instruction. Finally, the code generator would detect that the
immediate was less than 0, flip the sign and replace the add with a
subtract of 0x80000000. Because the x64 subtract instruction's
immediate field is 32 bits, the processor would interpret this as
0xffffffff80000000 instead of an unsigned value.

This change fixes the issue by making the CanBeImmediate check
explicitly compare against INT_MIN and INT_MAX. We disallow INT_MIN
as an immediate precisely because we cannot tell 0x0000000080000000
from 0xffffffff80000000 when truncated to 32 bits.

Bug: chromium:711203
Change-Id: Ie371b8ea290684a6bb723bae9c693a866f961850
Reviewed-on: https://chromium-review.googlesource.com/482448
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44758}
2017-04-20 21:03:31 +00:00
..
loop-stack-check.js
regress-5860.js [wasm] Do not patch memory references in imported functions. 2017-01-24 09:43:57 +00:00
regress-709684.js Fixed accounting issues due to code table containing imports as well as wasm funcs. 2017-04-10 14:03:59 +00:00
regress-712569.js [wasm] Fix DCHECK handiling pending exceptions. 2017-04-18 19:15:12 +00:00
regression-5531.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
regression-5800.js [wasm] Fix codegen issue for i64.add and i64.sub on ia32 2017-01-19 01:16:19 +00:00
regression-5884.js [wasm] Do the default int64-lowering for all non-i64 stores. 2017-01-26 09:38:13 +00:00
regression-6054.js [wasm][arm] Emit MaybeCheckConstPool in the trap code generation 2017-03-20 09:52:04 +00:00
regression-6164.js [wasm] Consider void returns in the int64-lowering 2017-03-29 13:51:33 +00:00
regression-02256.js [tests] Cleanup tests that use assertOptimized()/assertUnoptimized(). 2017-01-26 17:39:09 +00:00
regression-02256b.js [tests] Cleanup tests that use assertOptimized()/assertUnoptimized(). 2017-01-26 17:39:09 +00:00
regression-02862.js
regression-643595.js [wasm] disable serialization for asm-wasm 2016-12-15 05:06:54 +00:00
regression-644682.js
regression-647649.js
regression-648079.js
regression-651961.js
regression-654377.js
regression-663994.js [wasm] The exports property of a wasm instance should always exist 2017-01-10 09:55:10 +00:00
regression-666741.js
regression-667745.js [wasm] Some simplifications in function-body-decoder.cc. 2017-01-18 18:59:58 +00:00
regression-670683.js [wasm] Fix the regression-680683 test. 2017-03-30 17:37:29 +00:00
regression-674447.js [serializer] do not serialize script wrappers. 2016-12-19 10:53:02 +00:00
regression-680938.js [wasm] WebAssembly.Memory.grow() should handle the no instance case 2017-01-18 04:45:07 +00:00
regression-684858.js [wasm] Implement extensible name section 2017-04-07 16:31:47 +00:00
regression-688876.js [x64] Consider both operands when emitting the REX prefix for testb. 2017-02-08 10:27:45 +00:00
regression-689450.js [turbofan] For Word32Shl optimizations only consider the last 5 bits of the shift 2017-02-16 12:09:32 +00:00
regression-694433.js [wasm] Enforce module size limit early enough 2017-02-21 18:13:02 +00:00
regression-698587.js [wasm] Fix code specialization for empty memory buffer 2017-03-06 13:39:54 +00:00
regression-699485.js [wasm] Handle no initial memory case correctly when memory is exported 2017-04-18 06:34:16 +00:00
regression-702460.js [wasm] Gate SIMD load/store opcodes with the --wasm-simd-prototype flag. 2017-03-31 22:52:59 +00:00
regression-702839.js [wasm] Identify interpreter entry as direct call target 2017-03-20 14:58:55 +00:00
regression-703568.js [wasm] [asm.js] Store function start position also for init function 2017-03-22 17:02:16 +00:00
regression-708714.js [wasm] Stop decoding sections once an error occured 2017-04-10 13:00:50 +00:00
regression-710844.js [wasm] Handle no initial memory case correctly when memory is exported 2017-04-18 06:34:16 +00:00
regression-711203.js Restrict range for int64_t to immediate conversions 2017-04-20 21:03:31 +00:00