PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
__ SmiTag(size, size);
__ push(size);
- CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
+ if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
+ CallRuntimeFromDeferred(
+ Runtime::kAllocateInOldPointerSpace, 1, instr);
+ } else {
+ CallRuntimeFromDeferred(
+ Runtime::kAllocateInNewSpace, 1, instr);
+ }
__ StoreToSafepointRegisterSlot(r0, result);
}
DEFINE_bool(clever_optimizations,
true,
"Optimize object size, Array shift, DOM strings and string +")
-DEFINE_bool(pretenure_literals, false, "allocate literals in old space")
+DEFINE_bool(pretenure_literals, true, "allocate literals in old space")
// Flags for data representation optimizations
DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles")
NoObservableSideEffectsScope no_effects(this);
+ HAllocate::Flags flags = HAllocate::CAN_ALLOCATE_IN_NEW_SPACE;
+ // TODO(hpayer): add support for old data space
+ if (FLAG_pretenure_literals &&
+ isolate()->heap()->ShouldGloballyPretenure() &&
+ data_size == 0) {
+ flags = static_cast<HAllocate::Flags>(
+ flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ }
+
HValue* size_in_bytes =
AddInstruction(new(zone) HConstant(total_size,
Representation::Integer32()));
AddInstruction(new(zone) HAllocate(context,
size_in_bytes,
HType::JSObject(),
- HAllocate::CAN_ALLOCATE_IN_NEW_SPACE));
+ flags));
int offset = 0;
BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result,
&offset, mode);
__ StoreToSafepointRegisterSlot(result, size);
}
__ push(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);
}
PushSafepointRegistersScope scope(this);
__ Integer32ToSmi(size, size);
__ push(size);
- CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
+ if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
+ CallRuntimeFromDeferred(
+ Runtime::kAllocateInOldPointerSpace, 1, instr);
+ } else {
+ CallRuntimeFromDeferred(
+ Runtime::kAllocateInNewSpace, 1, instr);
+ }
__ StoreToSafepointRegisterSlot(result, rax);
}