Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 73c59df78766cebbdf2920025c2fbdfd823b076c..83ef3628dd07bade4ca4eb4e53715a2def1fd14f 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -4593,12 +4593,17 @@ void MacroAssembler::UndoAllocationInNewSpace(Register object) { |
void MacroAssembler::AllocateHeapNumber(Register result, |
Register scratch, |
- Label* gc_required) { |
+ Label* gc_required, |
+ MutableMode mode) { |
// Allocate heap number in new space. |
Allocate(HeapNumber::kSize, result, scratch, no_reg, gc_required, TAG_OBJECT); |
+ Heap::RootListIndex map_index = mode == MUTABLE |
+ ? Heap::kMutableHeapNumberMapRootIndex |
+ : Heap::kHeapNumberMapRootIndex; |
+ |
// Set the map. |
- LoadRoot(kScratchRegister, Heap::kHeapNumberMapRootIndex); |
+ LoadRoot(kScratchRegister, map_index); |
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
} |