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

Unified Diff: src/x64/lithium-codegen-x64.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/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 42c6e9148e71d6b5fe16dc810ac643efe43b8ce7..648a812765d3239bd9c0e72694ab4a9a9aa4c090 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -5039,11 +5039,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");
@@ -5053,6 +5057,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.
__ movq(map, FieldOperand(scratch, JSFunction::kPrototypeOrInitialMapOffset));
if (FLAG_debug_code) {
@@ -5099,7 +5104,11 @@ void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) {
PushSafepointRegistersScope scope(this);
__ Push(Smi::FromInt(instance_size));
- CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
+ if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
+ CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
+ } else {
+ CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
+ }
__ StoreToSafepointRegisterSlot(result, rax);
}

Powered by Google App Engine
This is Rietveld 408576698