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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 578443003: Support old-space allocation in generated code (bump block only for now). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 40518)
+++ runtime/vm/assembler_x64.cc (working copy)
@@ -3212,18 +3212,19 @@
if (FLAG_inline_alloc) {
Heap* heap = Isolate::Current()->heap();
const intptr_t instance_size = cls.instance_size();
- LoadImmediate(TMP, Immediate(heap->TopAddress()), pp);
+ Heap::Space space = heap->SpaceForAllocation(cls.id());
+ LoadImmediate(TMP, Immediate(heap->TopAddress(space)), pp);
movq(instance_reg, Address(TMP, 0));
AddImmediate(instance_reg, Immediate(instance_size), pp);
// instance_reg: potential next object start.
- LoadImmediate(TMP, Immediate(heap->EndAddress()), pp);
+ LoadImmediate(TMP, Immediate(heap->EndAddress(space)), pp);
cmpq(instance_reg, Address(TMP, 0));
j(ABOVE_EQUAL, failure, near_jump);
// Successfully allocated the object, now update top to point to
// next object start and store the class in the class field of object.
- LoadImmediate(TMP, Immediate(heap->TopAddress()), pp);
+ LoadImmediate(TMP, Immediate(heap->TopAddress(space)), pp);
movq(Address(TMP, 0), instance_reg);
- UpdateAllocationStats(cls.id());
+ UpdateAllocationStats(cls.id(), space);
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(instance_reg, Immediate(kHeapObjectTag - instance_size), pp);
uword tags = 0;
@@ -3248,8 +3249,8 @@
if (FLAG_inline_alloc) {
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
-
- movq(instance, Immediate(heap->TopAddress()));
+ Heap::Space space = heap->SpaceForAllocation(kArrayCid);
+ movq(instance, Immediate(heap->TopAddress(space)));
movq(instance, Address(instance, 0));
movq(end_address, RAX);
@@ -3259,16 +3260,16 @@
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
// end_address: potential next object start.
- movq(TMP, Immediate(heap->EndAddress()));
+ movq(TMP, Immediate(heap->EndAddress(space)));
cmpq(end_address, Address(TMP, 0));
j(ABOVE_EQUAL, failure);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- movq(TMP, Immediate(heap->TopAddress()));
+ movq(TMP, Immediate(heap->TopAddress(space)));
movq(Address(TMP, 0), end_address);
addq(instance, Immediate(kHeapObjectTag));
- UpdateAllocationStatsWithSize(kArrayCid, instance_size);
+ UpdateAllocationStatsWithSize(kArrayCid, instance_size, space);
// Initialize the tags.
// instance: new object start as a tagged pointer.

Powered by Google App Engine
This is Rietveld 408576698