Index: src/mips/code-stubs-mips.cc |
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc |
index ff00cb9f019285b058e83ee2a3293ba18e25f52d..741ce0740e3c65a7f7e641b6cffad4fb9d6a580c 100644 |
--- a/src/mips/code-stubs-mips.cc |
+++ b/src/mips/code-stubs-mips.cc |
@@ -4748,15 +4748,15 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { |
__ bind(&done_allocate); |
// Initialize the JSObject fields. |
- __ sw(a2, MemOperand(v0, JSObject::kMapOffset)); |
+ __ sw(a2, FieldMemOperand(v0, JSObject::kMapOffset)); |
__ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex); |
- __ sw(a3, MemOperand(v0, JSObject::kPropertiesOffset)); |
- __ sw(a3, MemOperand(v0, JSObject::kElementsOffset)); |
+ __ sw(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
+ __ sw(a3, FieldMemOperand(v0, JSObject::kElementsOffset)); |
STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); |
- __ Addu(a1, v0, Operand(JSObject::kHeaderSize)); |
+ __ Addu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); |
// ----------- S t a t e ------------- |
- // -- v0 : result (untagged) |
+ // -- v0 : result (tagged) |
// -- a1 : result fields (untagged) |
// -- t1 : result end (untagged) |
// -- a2 : initial map |
@@ -4774,11 +4774,7 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { |
{ |
// Initialize all in-object fields with undefined. |
__ InitializeFieldsWithFiller(a1, t1, a0); |
- |
- // Add the object tag to make the JSObject real. |
- STATIC_ASSERT(kHeapObjectTag == 1); |
- __ Ret(USE_DELAY_SLOT); |
- __ Addu(v0, v0, Operand(kHeapObjectTag)); // In delay slot. |
+ __ Ret(); |
} |
__ bind(&slack_tracking); |
{ |
@@ -4801,9 +4797,7 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { |
Label finalize; |
STATIC_ASSERT(Map::kSlackTrackingCounterEnd == 1); |
__ And(a3, a3, Operand(Map::ConstructionCounter::kMask)); |
- __ Branch(USE_DELAY_SLOT, &finalize, eq, a3, Operand(zero_reg)); |
- STATIC_ASSERT(kHeapObjectTag == 1); |
- __ Addu(v0, v0, Operand(kHeapObjectTag)); // In delay slot. |
+ __ Branch(&finalize, eq, a3, Operand(zero_reg)); |
__ Ret(); |
// Finalize the instance size. |
@@ -4828,10 +4822,10 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { |
__ CallRuntime(Runtime::kAllocateInNewSpace); |
__ Pop(a2); |
} |
- STATIC_ASSERT(kHeapObjectTag == 1); |
- __ Subu(v0, v0, Operand(kHeapObjectTag)); |
__ lbu(t1, FieldMemOperand(a2, Map::kInstanceSizeOffset)); |
__ Lsa(t1, v0, t1, kPointerSizeLog2); |
+ STATIC_ASSERT(kHeapObjectTag == 1); |
+ __ Subu(t1, t1, Operand(kHeapObjectTag)); |
__ jmp(&done_allocate); |
// Fall back to %NewObject. |
@@ -4893,7 +4887,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) { |
// Allocate an empty rest parameter array. |
Label allocate, done_allocate; |
- __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, TAG_OBJECT); |
+ __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS); |
__ bind(&done_allocate); |
// Setup the rest parameter array in v0. |
@@ -4935,7 +4929,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) { |
Label allocate, done_allocate; |
__ li(a1, Operand(JSArray::kSize + FixedArray::kHeaderSize)); |
__ Lsa(a1, a1, a0, kPointerSizeLog2 - 1); |
- __ Allocate(a1, v0, a3, t0, &allocate, TAG_OBJECT); |
+ __ Allocate(a1, v0, a3, t0, &allocate, NO_ALLOCATION_FLAGS); |
__ bind(&done_allocate); |
// Setup the elements array in v0. |
@@ -5069,7 +5063,7 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
__ Addu(t5, t5, Operand(JSSloppyArgumentsObject::kSize)); |
// Do the allocation of all three objects in one go. |
- __ Allocate(t5, v0, t5, t0, &runtime, TAG_OBJECT); |
+ __ Allocate(t5, v0, t5, t0, &runtime, NO_ALLOCATION_FLAGS); |
// v0 = address of new object(s) (tagged) |
// a2 = argument count (smi-tagged) |
@@ -5271,7 +5265,7 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
Label allocate, done_allocate; |
__ li(a1, Operand(JSStrictArgumentsObject::kSize + FixedArray::kHeaderSize)); |
__ Lsa(a1, a1, a0, kPointerSizeLog2 - 1); |
- __ Allocate(a1, v0, a3, t0, &allocate, TAG_OBJECT); |
+ __ Allocate(a1, v0, a3, t0, &allocate, NO_ALLOCATION_FLAGS); |
__ bind(&done_allocate); |
// Setup the elements array in v0. |