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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 2951333002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Removes the ZeroSizeScavenger test. Proper testing requires a second vm isolate. Created 3 years, 5 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
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 0a3f6dcfa91a6fcb76c0bdeb4b34bac9327fffad..9ff66685f9c024486a6bc5b8d7b4421e62aaa4bf 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -3420,16 +3420,15 @@ void Assembler::TryAllocate(const Class& cls,
// allocation call site.
NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), failure, near_jump));
const intptr_t instance_size = cls.instance_size();
- Heap::Space space = Heap::kNew;
- movq(temp, Address(THR, Thread::heap_offset()));
- movq(instance_reg, Address(temp, Heap::TopOffset(space)));
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
+ movq(instance_reg, Address(THR, Thread::top_offset()));
addq(instance_reg, Immediate(instance_size));
// instance_reg: potential next object start.
- cmpq(instance_reg, Address(temp, Heap::EndOffset(space)));
+ cmpq(instance_reg, Address(THR, Thread::end_offset()));
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.
- movq(Address(temp, Heap::TopOffset(space)), instance_reg);
+ movq(Address(THR, Thread::top_offset()), instance_reg);
NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space));
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(instance_reg, Immediate(kHeapObjectTag - instance_size));
@@ -3460,9 +3459,8 @@ void Assembler::TryAllocateArray(intptr_t cid,
// (i.e. the allocation stub) which will allocate the object and trace the
// allocation call site.
NOT_IN_PRODUCT(MaybeTraceAllocation(cid, failure, near_jump));
- Heap::Space space = Heap::kNew;
- movq(temp, Address(THR, Thread::heap_offset()));
- movq(instance, Address(temp, Heap::TopOffset(space)));
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
+ movq(instance, Address(THR, Thread::top_offset()));
movq(end_address, instance);
addq(end_address, Immediate(instance_size));
@@ -3471,12 +3469,12 @@ void Assembler::TryAllocateArray(intptr_t cid,
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
// end_address: potential next object start.
- cmpq(end_address, Address(temp, Heap::EndOffset(space)));
+ cmpq(end_address, Address(THR, Thread::end_offset()));
j(ABOVE_EQUAL, failure);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- movq(Address(temp, Heap::TopOffset(space)), end_address);
+ movq(Address(THR, Thread::top_offset()), end_address);
addq(instance, Immediate(kHeapObjectTag));
NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, instance_size, space));
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698