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

Unified Diff: runtime/vm/assembler_ia32.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_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 40518)
+++ runtime/vm/assembler_ia32.cc (working copy)
@@ -2502,15 +2502,16 @@
if (FLAG_inline_alloc) {
Heap* heap = Isolate::Current()->heap();
const intptr_t instance_size = cls.instance_size();
- movl(instance_reg, Address::Absolute(heap->TopAddress()));
+ Heap::Space space = heap->SpaceForAllocation(cls.id());
+ movl(instance_reg, Address::Absolute(heap->TopAddress(space)));
addl(instance_reg, Immediate(instance_size));
// instance_reg: potential next object start.
- cmpl(instance_reg, Address::Absolute(heap->EndAddress()));
+ cmpl(instance_reg, Address::Absolute(heap->EndAddress(space)));
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.
- movl(Address::Absolute(heap->TopAddress()), instance_reg);
- UpdateAllocationStats(cls.id(), temp_reg);
+ movl(Address::Absolute(heap->TopAddress(space)), instance_reg);
+ UpdateAllocationStats(cls.id(), temp_reg, space);
ASSERT(instance_size >= kHeapObjectTag);
subl(instance_reg, Immediate(instance_size - kHeapObjectTag));
uword tags = 0;
@@ -2534,7 +2535,8 @@
if (FLAG_inline_alloc) {
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
- movl(instance, Address::Absolute(heap->TopAddress()));
+ Heap::Space space = heap->SpaceForAllocation(cid);
+ movl(instance, Address::Absolute(heap->TopAddress(space)));
movl(end_address, instance);
addl(end_address, Immediate(instance_size));
@@ -2543,14 +2545,14 @@
// Check if the allocation fits into the remaining space.
// EAX: potential new object start.
// EBX: potential next object start.
- cmpl(end_address, Address::Absolute(heap->EndAddress()));
+ cmpl(end_address, Address::Absolute(heap->EndAddress(space)));
j(ABOVE_EQUAL, failure);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- movl(Address::Absolute(heap->TopAddress()), end_address);
+ movl(Address::Absolute(heap->TopAddress(space)), end_address);
addl(instance, Immediate(kHeapObjectTag));
- UpdateAllocationStatsWithSize(cid, instance_size, kNoRegister);
+ UpdateAllocationStatsWithSize(cid, instance_size, kNoRegister, space);
// Initialize the tags.
uword tags = 0;

Powered by Google App Engine
This is Rietveld 408576698