diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc index 452521c942..1901f9c413 100644 --- a/src/mips/builtins-mips.cc +++ b/src/mips/builtins-mips.cc @@ -227,13 +227,12 @@ static void AllocateJSArray(MacroAssembler* masm, (JSArray::kSize + FixedArray::kHeaderSize) / kPointerSize); __ sra(scratch1, array_size, kSmiTagSize); __ Addu(elements_array_end, elements_array_end, scratch1); - __ AllocateInNewSpace( - elements_array_end, - result, - scratch1, - scratch2, - gc_required, - static_cast(TAG_OBJECT | SIZE_IN_WORDS)); + __ Allocate(elements_array_end, + result, + scratch1, + scratch2, + gc_required, + static_cast(TAG_OBJECT | SIZE_IN_WORDS)); // Allocated the JSArray. Now initialize the fields except for the elements // array. @@ -895,7 +894,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, // a1: constructor function // a2: initial map __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset)); - __ AllocateInNewSpace(a3, t4, t5, t6, &rt_call, SIZE_IN_WORDS); + __ Allocate(a3, t4, t5, t6, &rt_call, SIZE_IN_WORDS); // Allocated the JSObject, now initialize the fields. Map is set to // initial map and properties and elements are set to empty fixed array. @@ -974,7 +973,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, // t4: JSObject // t5: start of next object __ Addu(a0, a3, Operand(FixedArray::kHeaderSize / kPointerSize)); - __ AllocateInNewSpace( + __ Allocate( a0, t5, t6, diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 462ee4c529..8faa29ceda 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -4872,7 +4872,7 @@ void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { __ Addu(t5, t5, Operand(Heap::kArgumentsObjectSize)); // Do the allocation of all three objects in one go. - __ AllocateInNewSpace(t5, v0, a3, t0, &runtime, TAG_OBJECT); + __ Allocate(t5, v0, a3, t0, &runtime, TAG_OBJECT); // v0 = address of new object(s) (tagged) // a2 = argument count (tagged) @@ -5063,13 +5063,8 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { __ Addu(a1, a1, Operand(Heap::kArgumentsObjectSizeStrict / kPointerSize)); // Do the allocation of both objects in one go. - __ AllocateInNewSpace(a1, - v0, - a2, - a3, - &runtime, - static_cast(TAG_OBJECT | - SIZE_IN_WORDS)); + __ Allocate(a1, v0, a2, a3, &runtime, + static_cast(TAG_OBJECT | SIZE_IN_WORDS)); // Get the arguments boilerplate from the current native context. __ lw(t0, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); @@ -5589,7 +5584,7 @@ void RegExpConstructResultStub::Generate(MacroAssembler* masm) { (JSRegExpResult::kSize + FixedArray::kHeaderSize) / kPointerSize; __ srl(t1, a1, kSmiTagSize + kSmiShiftSize); __ Addu(a2, t1, Operand(objects_size)); - __ AllocateInNewSpace( + __ Allocate( a2, // In: Size, in words. v0, // Out: Start of allocation (tagged). a3, // Scratch register. diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc index 967bb5b35b..bd403cee6f 100644 --- a/src/mips/codegen-mips.cc +++ b/src/mips/codegen-mips.cc @@ -206,8 +206,9 @@ void ElementsTransitionGenerator::GenerateSmiToDouble( // Allocate new FixedDoubleArray. __ sll(scratch, t1, 2); __ Addu(scratch, scratch, FixedDoubleArray::kHeaderSize); - __ AllocateInNewSpace(scratch, t2, t3, t5, &gc_required, NO_ALLOCATION_FLAGS); + __ Allocate(scratch, t2, t3, t5, &gc_required, NO_ALLOCATION_FLAGS); // t2: destination FixedDoubleArray, not tagged as heap object + // Set destination FixedDoubleArray's length and map. __ LoadRoot(t5, Heap::kFixedDoubleArrayMapRootIndex); __ sw(t1, MemOperand(t2, FixedDoubleArray::kLengthOffset)); @@ -351,7 +352,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( // Allocate new FixedArray. __ sll(a0, t1, 1); __ Addu(a0, a0, FixedDoubleArray::kHeaderSize); - __ AllocateInNewSpace(a0, t2, t3, t5, &gc_required, NO_ALLOCATION_FLAGS); + __ Allocate(a0, t2, t3, t5, &gc_required, NO_ALLOCATION_FLAGS); // t2: destination FixedArray, not tagged as heap object // Set destination FixedDoubleArray's length and map. __ LoadRoot(t5, Heap::kFixedArrayMapRootIndex); diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 56099d97f0..9fa5f79800 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -5351,12 +5351,12 @@ void LCodeGen::DoAllocate(LAllocate* instr) { __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); } else { Register size = ToRegister(instr->size()); - __ AllocateInNewSpace(size, - result, - scratch, - scratch2, - deferred->entry(), - flags); + __ Allocate(size, + result, + scratch, + scratch2, + deferred->entry(), + flags); } __ bind(deferred->exit()); diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 33ff9aba64..271c6d8cd5 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -3002,13 +3002,12 @@ void MacroAssembler::Allocate(int object_size, } -void MacroAssembler::AllocateInNewSpace(Register object_size, - Register result, - Register scratch1, - Register scratch2, - Label* gc_required, - AllocationFlags flags) { - ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0); +void MacroAssembler::Allocate(Register object_size, + Register result, + Register scratch1, + Register scratch2, + Label* gc_required, + AllocationFlags flags) { if (!FLAG_inline_new) { if (emit_debug_code()) { // Trash the registers to simulate an allocation failure. @@ -3029,19 +3028,19 @@ void MacroAssembler::AllocateInNewSpace(Register object_size, // Check relative positions of allocation top and limit addresses. // ARM adds additional checks to make sure the ldm instruction can be // used. On MIPS we don't have ldm so we don't need additional checks either. - ExternalReference new_space_allocation_top = - ExternalReference::new_space_allocation_top_address(isolate()); - ExternalReference new_space_allocation_limit = - ExternalReference::new_space_allocation_limit_address(isolate()); + ExternalReference allocation_top = + AllocationUtils::GetAllocationTopReference(isolate(), flags); + ExternalReference allocation_limit = + AllocationUtils::GetAllocationLimitReference(isolate(), flags); intptr_t top = - reinterpret_cast(new_space_allocation_top.address()); + reinterpret_cast(allocation_top.address()); intptr_t limit = - reinterpret_cast(new_space_allocation_limit.address()); + reinterpret_cast(allocation_limit.address()); ASSERT((limit - top) == kPointerSize); // Set up allocation top address and object size registers. Register topaddr = scratch1; - li(topaddr, Operand(new_space_allocation_top)); + li(topaddr, Operand(allocation_top)); // This code stores a temporary value in t9. if ((flags & RESULT_CONTAINS_TOP) == 0) { @@ -3120,12 +3119,12 @@ void MacroAssembler::AllocateTwoByteString(Register result, And(scratch1, scratch1, Operand(~kObjectAlignmentMask)); // Allocate two-byte string in new space. - AllocateInNewSpace(scratch1, - result, - scratch2, - scratch3, - gc_required, - TAG_OBJECT); + Allocate(scratch1, + result, + scratch2, + scratch3, + gc_required, + TAG_OBJECT); // Set the map, length and hash field. InitializeNewString(result, @@ -3150,12 +3149,12 @@ void MacroAssembler::AllocateAsciiString(Register result, And(scratch1, scratch1, Operand(~kObjectAlignmentMask)); // Allocate ASCII string in new space. - AllocateInNewSpace(scratch1, - result, - scratch2, - scratch3, - gc_required, - TAG_OBJECT); + Allocate(scratch1, + result, + scratch2, + scratch3, + gc_required, + TAG_OBJECT); // Set the map, length and hash field. InitializeNewString(result, diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index e4cf3bcb7c..4198f8ba16 100644 --- a/src/mips/macro-assembler-mips.h +++ b/src/mips/macro-assembler-mips.h @@ -491,12 +491,12 @@ class MacroAssembler: public Assembler { Label* gc_required, AllocationFlags flags); - void AllocateInNewSpace(Register object_size, - Register result, - Register scratch1, - Register scratch2, - Label* gc_required, - AllocationFlags flags); + void Allocate(Register object_size, + Register result, + Register scratch1, + Register scratch2, + Label* gc_required, + AllocationFlags flags); // Undo allocation in new space. The object passed and objects allocated after // it will no longer be allocated. The caller must make sure that no pointers diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 841fb06670..da6770a14c 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -3023,7 +3023,7 @@ Handle ConstructStubCompiler::CompileConstructStub( __ Check(eq, "Instance size of initial map changed.", a3, Operand(instance_size >> kPointerSizeLog2)); #endif - __ AllocateInNewSpace(a3, t4, t5, t6, &generic_stub_call, SIZE_IN_WORDS); + __ Allocate(a3, t4, t5, t6, &generic_stub_call, SIZE_IN_WORDS); // Allocated the JSObject, now initialize the fields. Map is set to initial // map and properties and elements are set to empty fixed array.