Index: src/ia32/ic-ia32.cc |
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc |
index c2181e7134f3838a9d1dafc70d2c596f0c6635c1..50ea5416075670d7ee0dba1bd47efb3c7c251dd4 100644 |
--- a/src/ia32/ic-ia32.cc |
+++ b/src/ia32/ic-ia32.cc |
@@ -811,23 +811,23 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
// edx: receiver |
// edi: FixedArray receiver->elements |
+ Label non_smi_value; |
+ __ JumpIfNotSmi(eax, &non_smi_value); |
+ // It's irrelevant whether array is smi-only or not when writing a smi. |
+ __ mov(CodeGenerator::FixedArrayElementOperand(edi, ecx), eax); |
+ __ ret(0); |
+ |
+ __ bind(&non_smi_value); |
if (FLAG_smi_only_arrays) { |
Rico
2011/09/24 18:40:36
Move (corrected) comment from ic-arm.cc in here
|
- Label not_smi_only; |
- // Make sure the elements are smi-only. |
__ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
- __ CheckFastSmiOnlyElements(ebx, ¬_smi_only, Label::kNear); |
- // Non-smis need to call into the runtime if the array is smi only. |
- __ JumpIfNotSmi(eax, &slow); |
- __ mov(CodeGenerator::FixedArrayElementOperand(edi, ecx), eax); |
- __ ret(0); |
- __ bind(¬_smi_only); |
+ __ CheckFastObjectElements(ebx, &slow, Label::kNear); |
} |
- |
+ // Fast elements array, store the value to the elements backing store. |
__ mov(CodeGenerator::FixedArrayElementOperand(edi, ecx), eax); |
- |
// Update write barrier for the elements array address. |
__ mov(edx, Operand(eax)); // Preserve the value which is returned. |
- __ RecordWriteArray(edi, edx, ecx, kDontSaveFPRegs); |
+ __ RecordWriteArray( |
+ edi, edx, ecx, kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
__ ret(0); |
} |