Index: src/arm/ic-arm.cc |
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc |
index 145d668d76c83238d98f8f173ad965c9d5686588..9932125a719baedf5b1712fb22bf8e2e4099cbc2 100644 |
--- a/src/arm/ic-arm.cc |
+++ b/src/arm/ic-arm.cc |
@@ -1360,6 +1360,20 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
__ bind(&fast); |
Register scratch_value = r4; |
Register address = r5; |
+ if (FLAG_smi_only_arrays) { |
+ Label not_smi_only; |
+ // Make sure the elements are smi-only. |
+ __ 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); |
+ } |
// Fast case, store the value to the elements backing store. |
__ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
__ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); |