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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 2980033002: Moves the top_ and end_ words of the Scavenger into mutator thread. (Closed)
Patch Set: 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_arm64.cc ('k') | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index d06a3be4666ff4455d74a3ac4f4df4cc75aeaa2a..6d1c0a6747c6031e44bc35d20f1fe0854227f116 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -2342,16 +2342,15 @@ void Assembler::TryAllocate(const Class& cls,
NOT_IN_PRODUCT(
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)));
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
+ 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));
@@ -2379,9 +2378,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, 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)));
+ NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
+ movl(instance, Address(THR, Thread::top_offset()));
movl(end_address, instance);
addl(end_address, Immediate(instance_size));
@@ -2390,12 +2388,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698