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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 2974403002: Revert "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 8cb9b43e1e9104ba5a9e7d7ef61aba9c764aac3f..a437c29cf829b1772eaf0c70a2b043b07ba20f12 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -2630,15 +2630,16 @@ 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();
- NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
- movl(instance_reg, Address(THR, Thread::top_offset()));
+ Heap::Space space = Heap::kNew;
+ movl(temp_reg, Address(THR, Thread::heap_offset()));
+ movl(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
addl(instance_reg, Immediate(instance_size));
// instance_reg: potential next object start.
- cmpl(instance_reg, Address(THR, Thread::end_offset()));
+ cmpl(instance_reg, Address(temp_reg, Heap::EndOffset(space)));
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(THR, Thread::top_offset()), instance_reg);
+ movl(Address(temp_reg, Heap::TopOffset(space)), instance_reg);
NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), temp_reg, space));
ASSERT(instance_size >= kHeapObjectTag);
subl(instance_reg, Immediate(instance_size - kHeapObjectTag));
@@ -2667,8 +2668,9 @@ 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));
- NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
- movl(instance, Address(THR, Thread::top_offset()));
+ Heap::Space space = Heap::kNew;
+ movl(temp_reg, Address(THR, Thread::heap_offset()));
+ movl(instance, Address(temp_reg, Heap::TopOffset(space)));
movl(end_address, instance);
addl(end_address, Immediate(instance_size));
@@ -2677,12 +2679,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(THR, Thread::end_offset()));
+ cmpl(end_address, Address(temp_reg, Heap::EndOffset(space)));
j(ABOVE_EQUAL, failure);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- movl(Address(THR, Thread::top_offset()), end_address);
+ movl(Address(temp_reg, Heap::TopOffset(space)), 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