DescriptionDo not directly load smi constants larger than a 16 bit payload on ia32.
Instead of emitting a large smi constant directly as an immediate, xor the
smi with a random 32-bit cookie at compile time, emit code to move that into
a register and then to xor the register with the cookie.
1. In unoptimized code constants are always loaded into a register in
ConstantInstr::EmitNativeCode. Change it to load safely.
2. In optimized code constants loaded into a register for use by an
instruction are loaded by ParallelMoveResolver::EmitMove. Change it to
load safely.
3. In optimized code some instructions allow constants as inputs. These are
reflected with an input location of Location::RegisterOrConstant (or
similar) or else Location::Constant. For the former allocate a register
if the constant is unsafe, and for the latter check for safety before
allowing the constant input.
BUG=https://code.google.com/p/dart/issues/detail?id=1742
R=iposva@google.com, srdjan@google.com
Committed: https://code.google.com/p/dart/source/detail?r=29439
Patch Set 1 #
Total comments: 1
Messages
Total messages: 4 (0 generated)
|