Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index 43796b1f887bd3f2e52018e013b1eb41bc8302c4..d79256a875d604421ef50c5140e783ff9ddb96e1 100644 |
--- a/src/arm64/macro-assembler-arm64.cc |
+++ b/src/arm64/macro-assembler-arm64.cc |
@@ -3560,7 +3560,8 @@ void MacroAssembler::AllocateHeapNumber(Register result, |
Register scratch1, |
Register scratch2, |
CPURegister value, |
- CPURegister heap_number_map) { |
+ CPURegister heap_number_map, |
+ MutableMode mode) { |
ASSERT(!value.IsValid() || value.Is64Bits()); |
UseScratchRegisterScope temps(this); |
@@ -3569,6 +3570,10 @@ void MacroAssembler::AllocateHeapNumber(Register result, |
Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
NO_ALLOCATION_FLAGS); |
+ Heap::RootListIndex map_index = mode == MUTABLE |
+ ? Heap::kMutableHeapNumberMapRootIndex |
+ : Heap::kHeapNumberMapRootIndex; |
+ |
// Prepare the heap number map. |
if (!heap_number_map.IsValid()) { |
// If we have a valid value register, use the same type of register to store |
@@ -3578,7 +3583,7 @@ void MacroAssembler::AllocateHeapNumber(Register result, |
} else { |
heap_number_map = scratch1; |
} |
- LoadRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); |
+ LoadRoot(heap_number_map, map_index); |
} |
if (emit_debug_code()) { |
Register map; |
@@ -3588,7 +3593,7 @@ void MacroAssembler::AllocateHeapNumber(Register result, |
} else { |
map = Register(heap_number_map); |
} |
- AssertRegisterIsRoot(map, Heap::kHeapNumberMapRootIndex); |
+ AssertRegisterIsRoot(map, map_index); |
} |
// Store the heap number map and the value in the allocated object. |