MIPS64: Reland r22082 "Replace HeapNumber as doublebox with an explicit MutableHeapNumber.

Port r22129 (676bb14).

TEST=
BUG=
R=balazs.kilvady@imgtec.com, paul.lind@imgtec.com

Review URL: https://codereview.chromium.org/395803002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22410 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8e1ece25
...@@ -3385,14 +3385,19 @@ void MacroAssembler::AllocateHeapNumber(Register result, ...@@ -3385,14 +3385,19 @@ void MacroAssembler::AllocateHeapNumber(Register result,
Register scratch2, Register scratch2,
Register heap_number_map, Register heap_number_map,
Label* need_gc, Label* need_gc,
TaggingMode tagging_mode) { TaggingMode tagging_mode,
MutableMode mode) {
// Allocate an object in the heap for the heap number and tag it as a heap // Allocate an object in the heap for the heap number and tag it as a heap
// object. // object.
Allocate(HeapNumber::kSize, result, scratch1, scratch2, need_gc, Allocate(HeapNumber::kSize, result, scratch1, scratch2, need_gc,
tagging_mode == TAG_RESULT ? TAG_OBJECT : NO_ALLOCATION_FLAGS); tagging_mode == TAG_RESULT ? TAG_OBJECT : NO_ALLOCATION_FLAGS);
Heap::RootListIndex map_index = mode == MUTABLE
? Heap::kMutableHeapNumberMapRootIndex
: Heap::kHeapNumberMapRootIndex;
AssertIsRoot(heap_number_map, map_index);
// Store heap number map in the allocated object. // Store heap number map in the allocated object.
AssertIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
if (tagging_mode == TAG_RESULT) { if (tagging_mode == TAG_RESULT) {
sd(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); sd(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset));
} else { } else {
......
...@@ -574,7 +574,9 @@ class MacroAssembler: public Assembler { ...@@ -574,7 +574,9 @@ class MacroAssembler: public Assembler {
Register scratch2, Register scratch2,
Register heap_number_map, Register heap_number_map,
Label* gc_required, Label* gc_required,
TaggingMode tagging_mode = TAG_RESULT); TaggingMode tagging_mode = TAG_RESULT,
MutableMode mode = IMMUTABLE);
void AllocateHeapNumberWithValue(Register result, void AllocateHeapNumberWithValue(Register result,
FPURegister value, FPURegister value,
Register scratch1, Register scratch1,
......
...@@ -414,8 +414,9 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, ...@@ -414,8 +414,9 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
} }
} else if (representation.IsDouble()) { } else if (representation.IsDouble()) {
Label do_store, heap_number; Label do_store, heap_number;
__ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); __ LoadRoot(scratch3, Heap::kMutableHeapNumberMapRootIndex);
__ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow,
TAG_RESULT, MUTABLE);
__ JumpIfNotSmi(value_reg, &heap_number); __ JumpIfNotSmi(value_reg, &heap_number);
__ SmiUntag(scratch1, value_reg); __ SmiUntag(scratch1, value_reg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment