Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 8068da48628b9362862c926aa564506267d5f5c3..6c9bfefb96947ecc8a2b4e14dc1a401bcc3e593b 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1504,15 +1504,25 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
VisitForAccumulatorValue(subexpr); |
// Store the subexpression value in the array's elements. |
- __ ldr(r1, MemOperand(sp)); // Copy of array literal. |
- __ ldr(r1, FieldMemOperand(r1, JSObject::kElementsOffset)); |
+ __ ldr(r6, MemOperand(sp)); // Copy of array literal. |
+ __ ldr(r1, FieldMemOperand(r6, JSObject::kElementsOffset)); |
int offset = FixedArray::kHeaderSize + (i * kPointerSize); |
__ str(result_register(), FieldMemOperand(r1, offset)); |
+ Label no_map_change; |
+ __ JumpIfSmi(result_register(), &no_map_change); |
// Update the write barrier for the array store with r0 as the scratch |
// register. |
__ RecordWriteField( |
- r1, offset, result_register(), r2, kLRHasBeenSaved, kDontSaveFPRegs); |
+ r1, offset, result_register(), r2, kLRHasBeenSaved, kDontSaveFPRegs, |
+ EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
+ if (FLAG_smi_only_arrays) { |
+ __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); |
+ __ CheckFastSmiOnlyElements(r3, r2, &no_map_change); |
+ __ push(r6); |
Rico
2011/09/22 17:06:07
maybe a comment here:
__ push(r6); // Copy of arr
|
+ __ CallRuntime(Runtime::kNonSmiElementStored, 1); |
+ } |
+ __ bind(&no_map_change); |
PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); |
} |