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

Unified Diff: runtime/vm/intrinsifier_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/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 40518)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -286,8 +286,8 @@
__ leal(EDI, Address(EDI, scale_factor, fixed_size)); \
__ andl(EDI, Immediate(-kObjectAlignment)); \
Heap* heap = Isolate::Current()->heap(); \
- \
- __ movl(EAX, Address::Absolute(heap->TopAddress())); \
+ Heap::Space space = heap->SpaceForAllocation(cid); \
+ __ movl(EAX, Address::Absolute(heap->TopAddress(space))); \
__ movl(EBX, EAX); \
\
/* EDI: allocation size. */ \
@@ -298,14 +298,14 @@
/* EAX: potential new object start. */ \
/* EBX: potential next object start. */ \
/* EDI: allocation size. */ \
- __ cmpl(EBX, Address::Absolute(heap->EndAddress())); \
+ __ cmpl(EBX, Address::Absolute(heap->EndAddress(space))); \
__ j(ABOVE_EQUAL, &fall_through); \
\
/* Successfully allocated the object(s), now update top to point to */ \
/* next object start and initialize the object. */ \
- __ movl(Address::Absolute(heap->TopAddress()), EBX); \
+ __ movl(Address::Absolute(heap->TopAddress(space)), EBX); \
__ addl(EAX, Immediate(kHeapObjectTag)); \
- __ UpdateAllocationStatsWithSize(cid, EDI, kNoRegister); \
+ __ UpdateAllocationStatsWithSize(cid, EDI, kNoRegister, space); \
\
/* Initialize the tags. */ \
/* EAX: new object start as a tagged pointer. */ \
@@ -1502,8 +1502,9 @@
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
-
- __ movl(EAX, Address::Absolute(heap->TopAddress()));
+ const intptr_t cid = kOneByteStringCid;
+ Heap::Space space = heap->SpaceForAllocation(cid);
+ __ movl(EAX, Address::Absolute(heap->TopAddress(space)));
__ movl(EBX, EAX);
// EDI: allocation size.
@@ -1514,15 +1515,15 @@
// EAX: potential new object start.
// EBX: potential next object start.
// EDI: allocation size.
- __ cmpl(EBX, Address::Absolute(heap->EndAddress()));
+ __ cmpl(EBX, Address::Absolute(heap->EndAddress(space)));
__ j(ABOVE_EQUAL, &pop_and_fail, Assembler::kNearJump);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- __ movl(Address::Absolute(heap->TopAddress()), EBX);
+ __ movl(Address::Absolute(heap->TopAddress(space)), EBX);
__ addl(EAX, Immediate(kHeapObjectTag));
- __ UpdateAllocationStatsWithSize(kOneByteStringCid, EDI, kNoRegister);
+ __ UpdateAllocationStatsWithSize(cid, EDI, kNoRegister, space);
// Initialize the tags.
// EAX: new object start as a tagged pointer.
@@ -1540,9 +1541,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());
- __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cls.id())));
+ __ orl(EDI, Immediate(RawObject::ClassIdTag::encode(cid)));
__ movl(FieldAddress(EAX, String::tags_offset()), EDI); // Tags.
}

Powered by Google App Engine
This is Rietveld 408576698