| Index: src/ia32/lithium-codegen-ia32.cc
|
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
|
| index bf014da2c7a3742cb848653d5557e31abc271ffb..148635e023ec83c1155dad8cfe43f402a3cb2ade 100644
|
| --- a/src/ia32/lithium-codegen-ia32.cc
|
| +++ b/src/ia32/lithium-codegen-ia32.cc
|
| @@ -5956,11 +5956,15 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
|
| initial_map->unused_property_fields() -
|
| initial_map->inobject_properties() == 0);
|
|
|
| - __ Allocate(instance_size, result, no_reg, scratch, deferred->entry(),
|
| - TAG_OBJECT);
|
| + AllocationFlags flags = TAG_OBJECT;
|
| + if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| + flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
|
| + }
|
| +
|
| + __ Allocate(instance_size, result, no_reg, scratch, deferred->entry(), 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");
|
| @@ -5970,6 +5974,7 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
|
| // Load the initial map.
|
| Register map = scratch;
|
| __ LoadHeapObject(scratch, constructor);
|
| + // Recording the map slot can be skipped, because maps are not compacted.
|
| __ mov(map, FieldOperand(scratch, JSFunction::kPrototypeOrInitialMapOffset));
|
|
|
| if (FLAG_debug_code) {
|
| @@ -6016,8 +6021,14 @@ void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) {
|
|
|
| PushSafepointRegistersScope scope(this);
|
| __ push(Immediate(Smi::FromInt(instance_size)));
|
| - CallRuntimeFromDeferred(
|
| - Runtime::kAllocateInNewSpace, 1, instr, instr->context());
|
| +
|
| + if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| + CallRuntimeFromDeferred(
|
| + Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context());
|
| + } else {
|
| + CallRuntimeFromDeferred(
|
| + Runtime::kAllocateInNewSpace, 1, instr, instr->context());
|
| + }
|
| __ StoreToSafepointRegisterSlot(result, eax);
|
| }
|
|
|
|
|