Index: src/crankshaft/ia32/lithium-codegen-ia32.cc |
diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.cc b/src/crankshaft/ia32/lithium-codegen-ia32.cc |
index df459fc23f0d1e8bd9d8c68aca212fadf2dc4628..91688061e1ea1dfb7016c64375153e121c2a59be 100644 |
--- a/src/crankshaft/ia32/lithium-codegen-ia32.cc |
+++ b/src/crankshaft/ia32/lithium-codegen-ia32.cc |
@@ -3974,7 +3974,15 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) { |
LOperand* key = instr->key(); |
if (key->IsConstantOperand()) { |
- __ mov(ebx, ToImmediate(key, Representation::Smi())); |
+ LConstantOperand* constant_key = LConstantOperand::cast(key); |
+ int32_t int_key = ToInteger32(constant_key); |
+ if (Smi::IsValid(int_key)) { |
+ __ mov(ebx, Immediate(Smi::FromInt(int_key))); |
+ } else { |
+ // We should never get here at runtime because there is a smi check on |
+ // the key before this point. |
+ __ int3(); |
+ } |
} else { |
__ Move(ebx, ToRegister(key)); |
__ SmiTag(ebx); |