Index: src/arm/ic-arm.cc |
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc |
index 9932125a719baedf5b1712fb22bf8e2e4099cbc2..cadddf3895da4a7679f7271616824bba69dd5273 100644 |
--- a/src/arm/ic-arm.cc |
+++ b/src/arm/ic-arm.cc |
@@ -1360,28 +1360,26 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
__ bind(&fast); |
Register scratch_value = r4; |
Register address = r5; |
+ |
+ Label non_smi_value; |
+ __ JumpIfNotSmi(value, &non_smi_value); |
+ // It's irrelevant whether array is smi-only or not when writing a smi. |
+ __ add(address, elements, |
Rico
2011/09/24 18:40:36
fits on one line
|
+ Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
+ __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); |
+ __ str(value, MemOperand(address)); |
+ __ Ret(); |
+ |
+ __ bind(&non_smi_value); |
if (FLAG_smi_only_arrays) { |
- Label not_smi_only; |
// Make sure the elements are smi-only. |
Rico
2011/09/24 18:40:36
Comment seems wrong now, that is not what we check
|
__ ldr(scratch_value, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
- __ CheckFastSmiOnlyElements(scratch_value, scratch_value, ¬_smi_only); |
- // Non-smis need to call into the runtime if the array is smi only. |
- __ JumpIfNotSmi(value, &slow); |
- __ add(address, elements, |
- Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
- __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); |
- __ str(value, MemOperand(address)); |
- __ Ret(); |
- __ bind(¬_smi_only); |
+ __ CheckFastObjectElements(scratch_value, scratch_value, &slow); |
} |
- // Fast case, store the value to the elements backing store. |
+ // Fast elements array, store the value to the elements backing store. |
__ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
__ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); |
__ str(value, MemOperand(address)); |
- // Skip write barrier if the written value is a smi. |
- __ tst(value, Operand(kSmiTagMask)); |
- __ Ret(eq); |
- |
// Update write barrier for the elements array address. |
__ mov(scratch_value, value); // Preserve the value which is returned. |
__ RecordWrite(elements, |
@@ -1391,7 +1389,6 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
kDontSaveFPRegs, |
EMIT_REMEMBERED_SET, |
OMIT_SMI_CHECK); |
- |
__ Ret(); |
} |