Index: src/arm/lithium-gap-resolver-arm.cc |
diff --git a/src/arm/lithium-gap-resolver-arm.cc b/src/arm/lithium-gap-resolver-arm.cc |
index 26f60fac112895b9330d6d7b55ea08c4a2710ef8..ee6cb8ec91c608ec4704945427452f9a6b8427ae 100644 |
--- a/src/arm/lithium-gap-resolver-arm.cc |
+++ b/src/arm/lithium-gap-resolver-arm.cc |
@@ -248,13 +248,24 @@ void LGapResolver::EmitMove(int index) { |
} |
} else if (source->IsConstantOperand()) { |
- Operand source_operand = cgen_->ToOperand(source); |
+ LConstantOperand* constant_source = LConstantOperand::cast(source); |
if (destination->IsRegister()) { |
- __ mov(cgen_->ToRegister(destination), source_operand); |
+ Register dst = cgen_->ToRegister(destination); |
+ if (cgen_->IsInteger32(constant_source)) { |
+ __ mov(dst, Operand(cgen_->ToInteger32(constant_source))); |
+ } else { |
+ __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
+ } |
} else { |
ASSERT(destination->IsStackSlot()); |
ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. |
- __ mov(kSavedValueRegister, source_operand); |
+ if (cgen_->IsInteger32(constant_source)) { |
+ __ mov(kSavedValueRegister, |
+ Operand(cgen_->ToInteger32(constant_source))); |
+ } else { |
+ __ LoadObject(kSavedValueRegister, |
+ cgen_->ToHandle(constant_source)); |
+ } |
__ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); |
} |