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

Unified Diff: src/arm/lithium-codegen-arm.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
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index e12fcb761acf29707f924f0eac2dd4ac26243de3..4818a91aa8dea5bd0625baaa1fca3a2792635efe 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -5362,11 +5362,16 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
initial_map->unused_property_fields() -
initial_map->inobject_properties() == 0);
+ AllocationFlags flags = TAG_OBJECT;
+ if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
+ flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
+ }
+
__ Allocate(instance_size, result, scratch, scratch2, deferred->entry(),
- TAG_OBJECT);
+ 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");
@@ -5376,6 +5381,7 @@ void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
// Load the initial map.
Register map = scratch;
__ LoadHeapObject(map, constructor);
+ // Recording the map slot can be skipped, because maps are not compacted.
__ ldr(map, FieldMemOperand(map, JSFunction::kPrototypeOrInitialMapOffset));
// Initialize map and fields of the newly allocated object.
@@ -5407,7 +5413,11 @@ void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) {
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
__ mov(r0, Operand(Smi::FromInt(instance_size)));
__ push(r0);
- CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
+ if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
+ CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
+ } else {
+ CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
+ }
__ StoreToSafepointRegisterSlot(r0, result);
}
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698