Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index de62e1fd3b4cde31d756b00611e83975fc236080..10a8aef999ef28061cf0c8e42c2c0650a5f39fda 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -4264,15 +4264,15 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
if (instr->value()->IsConstantOperand()) { |
LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
if (IsInteger32(operand_value)) { |
- int const_value = ToInteger32(operand_value); |
- __ mov(FieldOperand(write_register, offset), Immediate(const_value)); |
+ // In lithium register preparation, we made sure that the constant integer |
+ // operand fits into smi range. |
+ Smi* smi_value = Smi::FromInt(ToInteger32(operand_value)); |
+ __ mov(FieldOperand(write_register, offset), Immediate(smi_value)); |
+ } else if (operand_value->IsRegister()) { |
+ __ mov(FieldOperand(write_register, offset), ToRegister(operand_value)); |
} else { |
- if (operand_value->IsRegister()) { |
- __ mov(FieldOperand(write_register, offset), ToRegister(operand_value)); |
- } else { |
- Handle<Object> handle_value = ToHandle(operand_value); |
- __ mov(FieldOperand(write_register, offset), handle_value); |
- } |
+ Handle<Object> handle_value = ToHandle(operand_value); |
+ __ mov(FieldOperand(write_register, offset), handle_value); |
} |
} else { |
__ mov(FieldOperand(write_register, offset), ToRegister(instr->value())); |