Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index a8afa48c31ff20ec2385b157c14a6eb0ccfead50..e8593d98e33b5368b391ef97f0136ac263394c59 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -4066,12 +4066,23 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
return; |
} |
- __ AssertNotSmi(object); |
+ SmiCheck check_needed = |
+ instr->hydrogen()->value()->IsHeapObject() |
+ ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
- ASSERT(!representation.IsSmi() || |
- !instr->value()->IsConstantOperand() || |
- IsSmi(LConstantOperand::cast(instr->value()))); |
- if (representation.IsDouble()) { |
+ ASSERT(!(representation.IsSmi() && |
+ instr->value()->IsConstantOperand() && |
+ !IsSmi(LConstantOperand::cast(instr->value())))); |
+ if (representation.IsHeapObject()) { |
+ Register value = ToRegister(instr->value()); |
+ if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
+ __ SmiTst(value, scratch); |
+ DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); |
+ |
+ // We know now that value is not a smi, so we can omit the check below. |
+ check_needed = OMIT_SMI_CHECK; |
+ } |
+ } else if (representation.IsDouble()) { |
ASSERT(access.IsInobject()); |
ASSERT(!instr->hydrogen()->has_transition()); |
ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
@@ -4113,7 +4124,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
GetRAState(), |
kSaveFPRegs, |
EMIT_REMEMBERED_SET, |
- instr->hydrogen()->SmiCheckForWriteBarrier()); |
+ check_needed); |
} |
} else { |
__ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
@@ -4129,7 +4140,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
GetRAState(), |
kSaveFPRegs, |
EMIT_REMEMBERED_SET, |
- instr->hydrogen()->SmiCheckForWriteBarrier()); |
+ check_needed); |
} |
} |
} |