Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 11c641d93afcdcc9b0651bb2d39422f44b6b7659..5961ba6df9250cb9fd2b6c6d6720e33cabb8cf25 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -3380,13 +3380,13 @@ void MacroAssembler::CheckFastSmiElements(Register map, |
void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, |
Register key_reg, |
- Register receiver_reg, |
Register elements_reg, |
Register scratch1, |
Register scratch2, |
Register scratch3, |
Register scratch4, |
- Label* fail) { |
+ Label* fail, |
+ int elements_offset) { |
Label smi_value, maybe_nan, have_double_value, is_nan, done; |
Register mantissa_reg = scratch2; |
Register exponent_reg = scratch3; |
@@ -3412,8 +3412,10 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, |
bind(&have_double_value); |
sll(scratch1, key_reg, kDoubleSizeLog2 - kSmiTagSize); |
Addu(scratch1, scratch1, elements_reg); |
- sw(mantissa_reg, FieldMemOperand(scratch1, FixedDoubleArray::kHeaderSize)); |
- uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32); |
+ sw(mantissa_reg, FieldMemOperand( |
+ scratch1, FixedDoubleArray::kHeaderSize - elements_offset)); |
+ uint32_t offset = FixedDoubleArray::kHeaderSize - elements_offset + |
+ sizeof(kHoleNanLower32); |
sw(exponent_reg, FieldMemOperand(scratch1, offset)); |
jmp(&done); |
@@ -3433,7 +3435,8 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, |
bind(&smi_value); |
Addu(scratch1, elements_reg, |
- Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); |
+ Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag - |
+ elements_offset)); |
sll(scratch2, key_reg, kDoubleSizeLog2 - kSmiTagSize); |
Addu(scratch1, scratch1, scratch2); |
// scratch1 is now effective address of the double element |