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

Unified Diff: runtime/vm/intrinsifier_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/intrinsifier_x64.cc
===================================================================
--- runtime/vm/intrinsifier_x64.cc (revision 40518)
+++ runtime/vm/intrinsifier_x64.cc (working copy)
@@ -237,8 +237,8 @@
__ leaq(RDI, Address(RDI, scale_factor, fixed_size)); \
__ andq(RDI, Immediate(-kObjectAlignment)); \
Heap* heap = Isolate::Current()->heap(); \
- \
- __ movq(RAX, Immediate(heap->TopAddress())); \
+ Heap::Space space = heap->SpaceForAllocation(cid); \
+ __ movq(RAX, Immediate(heap->TopAddress(space))); \
__ movq(RAX, Address(RAX, 0)); \
__ movq(RCX, RAX); \
\
@@ -251,16 +251,16 @@
/* RCX: potential next object start. */ \
/* RDI: allocation size. */ \
/* R13: scratch register. */ \
- __ movq(R13, Immediate(heap->EndAddress())); \
+ __ movq(R13, Immediate(heap->EndAddress(space))); \
__ cmpq(RCX, Address(R13, 0)); \
__ j(ABOVE_EQUAL, &fall_through); \
\
/* Successfully allocated the object(s), now update top to point to */ \
/* next object start and initialize the object. */ \
- __ movq(R13, Immediate(heap->TopAddress())); \
+ __ movq(R13, Immediate(heap->TopAddress(space))); \
__ movq(Address(R13, 0), RCX); \
__ addq(RAX, Immediate(kHeapObjectTag)); \
- __ UpdateAllocationStatsWithSize(cid, RDI); \
+ __ UpdateAllocationStatsWithSize(cid, RDI, space); \
/* Initialize the tags. */ \
/* RAX: new object start as a tagged pointer. */ \
/* RCX: new object end address. */ \
@@ -1311,8 +1311,9 @@
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
-
- __ movq(RAX, Immediate(heap->TopAddress()));
+ const intptr_t cid = kOneByteStringCid;
+ Heap::Space space = heap->SpaceForAllocation(cid);
+ __ movq(RAX, Immediate(heap->TopAddress(space)));
__ movq(RAX, Address(RAX, 0));
// RDI: allocation size.
@@ -1324,16 +1325,16 @@
// RAX: potential new object start.
// RCX: potential next object start.
// RDI: allocation size.
- __ movq(R13, Immediate(heap->EndAddress()));
+ __ movq(R13, Immediate(heap->EndAddress(space)));
__ cmpq(RCX, Address(R13, 0));
__ j(ABOVE_EQUAL, &pop_and_fail);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- __ movq(R13, Immediate(heap->TopAddress()));
+ __ movq(R13, Immediate(heap->TopAddress(space)));
__ movq(Address(R13, 0), RCX);
__ addq(RAX, Immediate(kHeapObjectTag));
- __ UpdateAllocationStatsWithSize(kOneByteStringCid, RDI);
+ __ UpdateAllocationStatsWithSize(cid, RDI, space);
// Initialize the tags.
// RAX: new object start as a tagged pointer.
@@ -1350,9 +1351,7 @@
__ Bind(&done);
// Get the class index and insert it into the tags.
- const Class& cls =
- Class::Handle(isolate->object_store()->one_byte_string_class());
- __ orq(RDI, Immediate(RawObject::ClassIdTag::encode(cls.id())));
+ __ orq(RDI, Immediate(RawObject::ClassIdTag::encode(cid)));
__ movq(FieldAddress(RAX, String::tags_offset()), RDI); // Tags.
}

Powered by Google App Engine
This is Rietveld 408576698