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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 2951333002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: Full removal of heap's top/end offsets. Changed allocs in other archs. Created 3 years, 6 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
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index 7ef2204d7759d3664926237b9e95f7b3fc33696a..ac9b7e592dd292aebb49368ea4c80db8825a4e38 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -2631,15 +2631,14 @@ void Assembler::TryAllocate(const Class& cls,
MaybeTraceAllocation(cls.id(), temp_reg, failure, near_jump));
const intptr_t instance_size = cls.instance_size();
Heap::Space space = Heap::kNew;
- movl(temp_reg, Address(THR, Thread::heap_offset()));
- movl(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
+ movl(instance_reg, Address(THR, Thread::top_offset()));
addl(instance_reg, Immediate(instance_size));
// instance_reg: potential next object start.
- cmpl(instance_reg, Address(temp_reg, Heap::EndOffset(space)));
+ cmpl(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.
- movl(Address(temp_reg, Heap::TopOffset(space)), instance_reg);
+ movl(Address(THR, Thread::top_offset()), instance_reg);
NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), temp_reg, space));
ASSERT(instance_size >= kHeapObjectTag);
subl(instance_reg, Immediate(instance_size - kHeapObjectTag));
@@ -2669,8 +2668,7 @@ void Assembler::TryAllocateArray(intptr_t cid,
// allocation call site.
NOT_IN_PRODUCT(MaybeTraceAllocation(cid, temp_reg, failure, near_jump));
Heap::Space space = Heap::kNew;
- movl(temp_reg, Address(THR, Thread::heap_offset()));
- movl(instance, Address(temp_reg, Heap::TopOffset(space)));
+ movl(instance, Address(THR, Thread::top_offset()));
movl(end_address, instance);
addl(end_address, Immediate(instance_size));
@@ -2679,12 +2677,12 @@ void Assembler::TryAllocateArray(intptr_t cid,
// Check if the allocation fits into the remaining space.
// EAX: potential new object start.
// EBX: potential next object start.
- cmpl(end_address, Address(temp_reg, Heap::EndOffset(space)));
+ cmpl(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.
- movl(Address(temp_reg, Heap::TopOffset(space)), end_address);
+ movl(Address(THR, Thread::top_offset()), end_address);
addl(instance, Immediate(kHeapObjectTag));
NOT_IN_PRODUCT(
UpdateAllocationStatsWithSize(cid, instance_size, temp_reg, space));
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/assembler_x64.cc » ('j') | runtime/vm/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698