Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index ea6b3567e3fd7286f17d06245c0ce4a9d1bc5a93..f3f28ae49de395651030330a71822efd124e4c0b 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. |