Commit acc4568a authored by hpayer@chromium.org's avatar hpayer@chromium.org

Enable pretenuring of fast literals in high promotion mode.

BUG=

Review URL: https://codereview.chromium.org/13952008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14248 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 845990a3
...@@ -5472,7 +5472,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) { ...@@ -5472,7 +5472,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
__ SmiTag(size, size); __ SmiTag(size, size);
__ push(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); __ StoreToSafepointRegisterSlot(r0, result);
} }
......
...@@ -173,7 +173,7 @@ DEFINE_bool(compiled_keyed_stores, true, "use optimizing compiler to " ...@@ -173,7 +173,7 @@ DEFINE_bool(compiled_keyed_stores, true, "use optimizing compiler to "
DEFINE_bool(clever_optimizations, DEFINE_bool(clever_optimizations,
true, true,
"Optimize object size, Array shift, DOM strings and string +") "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 // Flags for data representation optimizations
DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles") DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of doubles")
......
...@@ -10101,6 +10101,15 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( ...@@ -10101,6 +10101,15 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
NoObservableSideEffectsScope no_effects(this); 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 = HValue* size_in_bytes =
AddInstruction(new(zone) HConstant(total_size, AddInstruction(new(zone) HConstant(total_size,
Representation::Integer32())); Representation::Integer32()));
...@@ -10108,7 +10117,7 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( ...@@ -10108,7 +10117,7 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
AddInstruction(new(zone) HAllocate(context, AddInstruction(new(zone) HAllocate(context,
size_in_bytes, size_in_bytes,
HType::JSObject(), HType::JSObject(),
HAllocate::CAN_ALLOCATE_IN_NEW_SPACE)); flags));
int offset = 0; int offset = 0;
BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result, BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result,
&offset, mode); &offset, mode);
......
...@@ -6001,8 +6001,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) { ...@@ -6001,8 +6001,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
__ StoreToSafepointRegisterSlot(result, size); __ StoreToSafepointRegisterSlot(result, size);
} }
__ push(size); __ push(size);
if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
CallRuntimeFromDeferred(
Runtime::kAllocateInOldPointerSpace, 1, instr, instr->context());
} else {
CallRuntimeFromDeferred( CallRuntimeFromDeferred(
Runtime::kAllocateInNewSpace, 1, instr, instr->context()); Runtime::kAllocateInNewSpace, 1, instr, instr->context());
}
__ StoreToSafepointRegisterSlot(result, eax); __ StoreToSafepointRegisterSlot(result, eax);
} }
......
...@@ -5104,7 +5104,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) { ...@@ -5104,7 +5104,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
PushSafepointRegistersScope scope(this); PushSafepointRegistersScope scope(this);
__ Integer32ToSmi(size, size); __ Integer32ToSmi(size, size);
__ push(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); __ StoreToSafepointRegisterSlot(result, rax);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment