Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index ecc052291a471a30773d4e138ff14a6b0e0a5748..dafbd25122d75435617336ca28fa262a1c3f88f0 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -3866,6 +3866,8 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
Register object = ToRegister(instr->object()); |
Handle<Map> transition = instr->transition(); |
+ SmiCheck check_needed = hinstr->value()->IsHeapObject() |
+ ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
if (FLAG_track_fields && representation.IsSmi()) { |
if (instr->value()->IsConstantOperand()) { |
@@ -3886,6 +3888,9 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
Register value = ToRegister(instr->value()); |
Condition cc = masm()->CheckSmi(value); |
DeoptimizeIf(cc, instr->environment()); |
+ |
+ // We know that value is a smi now, so we can omit the check below. |
+ check_needed = OMIT_SMI_CHECK; |
} |
} |
} else if (representation.IsDouble()) { |
@@ -3916,9 +3921,6 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
} |
// Do the store. |
- SmiCheck check_needed = hinstr->value()->IsHeapObject() |
- ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
- |
Register write_register = object; |
if (!access.IsInobject()) { |
write_register = ToRegister(instr->temp()); |