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

Unified Diff: runtime/vm/stub_code_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
« runtime/vm/stub_code_arm.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 40250)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -603,8 +603,8 @@
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
-
- __ movq(RAX, Immediate(heap->TopAddress()));
+ Heap::Space space = heap->SpaceForAllocation(kArrayCid);
+ __ movq(RAX, Immediate(heap->TopAddress(space)));
__ movq(RAX, Address(RAX, 0));
// RDI: allocation size.
@@ -616,16 +616,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, &slow_case);
// 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(kArrayCid, RDI);
+ __ UpdateAllocationStatsWithSize(kArrayCid, RDI, space);
// Initialize the tags.
// RAX: new object start as a tagged pointer.
// RDI: allocation size.
@@ -893,14 +893,16 @@
// Now allocate the object.
// R10: number of context variables.
- __ movq(RAX, Immediate(heap->TopAddress()));
+ intptr_t cid = context_class.id();
+ Heap::Space space = heap->SpaceForAllocation(cid);
+ __ movq(RAX, Immediate(heap->TopAddress(space)));
__ movq(RAX, Address(RAX, 0));
__ addq(R13, RAX);
// Check if the allocation fits into the remaining space.
// RAX: potential new object.
// R13: potential next object start.
// R10: number of context variables.
- __ movq(RDI, Immediate(heap->EndAddress()));
+ __ movq(RDI, Immediate(heap->EndAddress(space)));
__ cmpq(R13, Address(RDI, 0));
if (FLAG_use_slow_path) {
__ jmp(&slow_case);
@@ -913,12 +915,12 @@
// RAX: new object.
// R13: next object start.
// R10: number of context variables.
- __ movq(RDI, Immediate(heap->TopAddress()));
+ __ movq(RDI, Immediate(heap->TopAddress(space)));
__ movq(Address(RDI, 0), R13);
__ addq(RAX, Immediate(kHeapObjectTag));
// R13: Size of allocation in bytes.
__ subq(R13, RAX);
- __ UpdateAllocationStatsWithSize(context_class.id(), R13);
+ __ UpdateAllocationStatsWithSize(cid, R13, space);
// Calculate the size tag.
// RAX: new object.
@@ -941,7 +943,7 @@
// R10: number of context variables.
// R13: size and bit tags.
__ orq(R13,
- Immediate(RawObject::ClassIdTag::encode(context_class.id())));
+ Immediate(RawObject::ClassIdTag::encode(cid)));
__ movq(FieldAddress(RAX, Context::tags_offset()), R13); // Tags.
}
@@ -1091,14 +1093,15 @@
// next object start and initialize the allocated object.
// RDX: instantiated type arguments (if is_cls_parameterized).
Heap* heap = Isolate::Current()->heap();
- __ movq(RCX, Immediate(heap->TopAddress()));
+ Heap::Space space = heap->SpaceForAllocation(cls.id());
+ __ movq(RCX, Immediate(heap->TopAddress(space)));
__ movq(RAX, Address(RCX, 0));
__ leaq(RBX, Address(RAX, instance_size));
// Check if the allocation fits into the remaining space.
// RAX: potential new object start.
// RBX: potential next object start.
// RCX: heap top address.
- __ movq(R13, Immediate(heap->EndAddress()));
+ __ movq(R13, Immediate(heap->EndAddress(space)));
__ cmpq(RBX, Address(R13, 0));
if (FLAG_use_slow_path) {
__ jmp(&slow_case);
@@ -1106,7 +1109,7 @@
__ j(ABOVE_EQUAL, &slow_case);
}
__ movq(Address(RCX, 0), RBX);
- __ UpdateAllocationStats(cls.id());
+ __ UpdateAllocationStats(cls.id(), space);
// RAX: new object start.
// RBX: next object start.
« runtime/vm/stub_code_arm.cc ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698