| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index e12fcb761acf29707f924f0eac2dd4ac26243de3..4818a91aa8dea5bd0625baaa1fca3a2792635efe 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -5362,11 +5362,16 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
|
| initial_map->unused_property_fields() -
|
| initial_map->inobject_properties() == 0);
|
|
|
| + AllocationFlags flags = TAG_OBJECT;
|
| + if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| + flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
|
| + }
|
| +
|
| __ Allocate(instance_size, result, scratch, scratch2, deferred->entry(),
|
| - TAG_OBJECT);
|
| + flags);
|
|
|
| __ bind(deferred->exit());
|
| - if (FLAG_debug_code) {
|
| + if (FLAG_debug_code && !instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| Label is_in_new_space;
|
| __ JumpIfInNewSpace(result, scratch, &is_in_new_space);
|
| __ Abort("Allocated object is not in new-space");
|
| @@ -5376,6 +5381,7 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
|
| // Load the initial map.
|
| Register map = scratch;
|
| __ LoadHeapObject(map, constructor);
|
| + // Recording the map slot can be skipped, because maps are not compacted.
|
| __ ldr(map, FieldMemOperand(map, JSFunction::kPrototypeOrInitialMapOffset));
|
|
|
| // Initialize map and fields of the newly allocated object.
|
| @@ -5407,7 +5413,11 @@ void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) {
|
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
| __ mov(r0, Operand(Smi::FromInt(instance_size)));
|
| __ push(r0);
|
| - CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
|
| + if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| + CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
|
| + } else {
|
| + CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
|
| + }
|
| __ StoreToSafepointRegisterSlot(r0, result);
|
| }
|
|
|
|
|