Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index ae14f678b26eff7ae308b1399f16c06fc6ee091c..da95afb4d0f339abebed302810d8931c10227844 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -2912,12 +2912,12 @@ void MacroAssembler::ThrowUncatchable(Register value) { |
} |
-void MacroAssembler::AllocateInNewSpace(int object_size, |
- Register result, |
- Register scratch1, |
- Register scratch2, |
- Label* gc_required, |
- AllocationFlags flags) { |
+void MacroAssembler::Allocate(int 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. |
@@ -2945,20 +2945,21 @@ void MacroAssembler::AllocateInNewSpace(int 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<intptr_t>(new_space_allocation_top.address()); |
+ reinterpret_cast<intptr_t>(allocation_top.address()); |
intptr_t limit = |
- reinterpret_cast<intptr_t>(new_space_allocation_limit.address()); |
+ reinterpret_cast<intptr_t>(allocation_limit.address()); |
ASSERT((limit - top) == kPointerSize); |
// Set up allocation top address and object size registers. |
Register topaddr = scratch1; |
Register obj_size_reg = scratch2; |
- li(topaddr, Operand(new_space_allocation_top)); |
+ li(topaddr, Operand(allocation_top)); |
li(obj_size_reg, Operand(object_size)); |
// This code stores a temporary value in t9. |
@@ -2997,6 +2998,7 @@ void MacroAssembler::AllocateInNewSpace(Register object_size, |
Register scratch2, |
Label* gc_required, |
AllocationFlags flags) { |
+ ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0); |
if (!FLAG_inline_new) { |
if (emit_debug_code()) { |
// Trash the registers to simulate an allocation failure. |
@@ -3159,12 +3161,8 @@ void MacroAssembler::AllocateTwoByteConsString(Register result, |
Register scratch1, |
Register scratch2, |
Label* gc_required) { |
- AllocateInNewSpace(ConsString::kSize, |
- result, |
- scratch1, |
- scratch2, |
- gc_required, |
- TAG_OBJECT); |
+ Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required, |
+ TAG_OBJECT); |
InitializeNewString(result, |
length, |
Heap::kConsStringMapRootIndex, |
@@ -3178,12 +3176,8 @@ void MacroAssembler::AllocateAsciiConsString(Register result, |
Register scratch1, |
Register scratch2, |
Label* gc_required) { |
- AllocateInNewSpace(ConsString::kSize, |
- result, |
- scratch1, |
- scratch2, |
- gc_required, |
- TAG_OBJECT); |
+ Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required, |
+ TAG_OBJECT); |
InitializeNewString(result, |
length, |
Heap::kConsAsciiStringMapRootIndex, |
@@ -3197,12 +3191,8 @@ void MacroAssembler::AllocateTwoByteSlicedString(Register result, |
Register scratch1, |
Register scratch2, |
Label* gc_required) { |
- AllocateInNewSpace(SlicedString::kSize, |
- result, |
- scratch1, |
- scratch2, |
- gc_required, |
- TAG_OBJECT); |
+ Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required, |
+ TAG_OBJECT); |
InitializeNewString(result, |
length, |
@@ -3217,12 +3207,8 @@ void MacroAssembler::AllocateAsciiSlicedString(Register result, |
Register scratch1, |
Register scratch2, |
Label* gc_required) { |
- AllocateInNewSpace(SlicedString::kSize, |
- result, |
- scratch1, |
- scratch2, |
- gc_required, |
- TAG_OBJECT); |
+ Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required, |
+ TAG_OBJECT); |
InitializeNewString(result, |
length, |
@@ -3242,13 +3228,8 @@ void MacroAssembler::AllocateHeapNumber(Register result, |
TaggingMode tagging_mode) { |
// Allocate an object in the heap for the heap number and tag it as a heap |
// object. |
- AllocateInNewSpace(HeapNumber::kSize, |
- result, |
- scratch1, |
- scratch2, |
- need_gc, |
- tagging_mode == TAG_RESULT ? TAG_OBJECT : |
- NO_ALLOCATION_FLAGS); |
+ Allocate(HeapNumber::kSize, result, scratch1, scratch2, need_gc, |
+ tagging_mode == TAG_RESULT ? TAG_OBJECT : NO_ALLOCATION_FLAGS); |
// Store heap number map in the allocated object. |
AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); |