Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index 60a2129a60273eda55f7d6ca8b8b353ef7d1a267..866ab5575ba556806a2bc2293f57af82d3ba4f51 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -4783,8 +4783,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( |
__ AllocateInNewSpace(size, elements_reg, scratch1, scratch2, &slow, |
TAG_OBJECT); |
- // Initialize the new FixedDoubleArray. Leave elements unitialized for |
- // efficiency, they are guaranteed to be initialized before use. |
+ // Initialize the new FixedDoubleArray. |
__ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); |
__ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
__ mov(scratch1, |
@@ -4792,6 +4791,24 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( |
__ str(scratch1, |
FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); |
+ __ mov(scratch1, Operand(kHoleNanLower32)); |
+ __ mov(scratch2, Operand(kHoleNanUpper32)); |
+ for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { |
+ int offset = FixedDoubleArray::OffsetOfElementAt(i); |
+ __ str(scratch1, FieldMemOperand(elements_reg, offset)); |
+ __ str(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); |
+ } |
+ |
+ __ StoreNumberToDoubleElements(value_reg, |
+ key_reg, |
+ // All registers after this are overwritten. |
+ elements_reg, |
+ scratch1, |
+ scratch2, |
+ scratch3, |
+ scratch4, |
+ &transition_elements_kind); |
+ |
// Install the new backing store in the JSArray. |
__ str(elements_reg, |
FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
@@ -4804,7 +4821,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( |
__ str(length_reg, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
__ ldr(elements_reg, |
FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
- __ jmp(&finish_store); |
+ __ Ret(); |
__ bind(&check_capacity); |
// Make sure that the backing store can hold additional elements. |