Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 15734002: Add pretenuring support to HAllocateObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698