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

Unified Diff: runtime/vm/assembler_arm64.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_arm.cc ('k') | runtime/vm/assembler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64.cc
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 780303c84cc9a228088f5c11790a4b24e7e299dd..1d12ee89d2411e2c85f2446018e181ee8e8474bd 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -1343,20 +1343,21 @@ void Assembler::TryAllocate(const Class& cls,
// allocation call site.
NOT_IN_PRODUCT(MaybeTraceAllocation(cls.id(), temp_reg, failure));
const intptr_t instance_size = cls.instance_size();
- NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
- ldr(instance_reg, Address(THR, Thread::top_offset()));
+ Heap::Space space = Heap::kNew;
+ ldr(temp_reg, Address(THR, Thread::heap_offset()));
+ ldr(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
// TODO(koda): Protect against unsigned overflow here.
AddImmediateSetFlags(instance_reg, instance_reg, instance_size);
// instance_reg: potential next object start.
- ldr(TMP, Address(THR, Thread::end_offset()));
+ ldr(TMP, Address(temp_reg, Heap::EndOffset(space)));
CompareRegisters(TMP, instance_reg);
// fail if heap end unsigned less than or equal to instance_reg.
b(failure, LS);
// Successfully allocated the object, now update top to point to
// next object start and store the class in the class field of object.
- str(instance_reg, Address(THR, Thread::top_offset()));
+ str(instance_reg, Address(temp_reg, Heap::TopOffset(space)));
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(instance_reg, -instance_size + kHeapObjectTag);
@@ -1388,22 +1389,23 @@ 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, temp1, failure));
- NOT_IN_PRODUCT(Heap::Space space = Heap::kNew);
+ Heap::Space space = Heap::kNew;
+ ldr(temp1, Address(THR, Thread::heap_offset()));
// Potential new object start.
- ldr(instance, Address(THR, Thread::top_offset()));
+ ldr(instance, Address(temp1, Heap::TopOffset(space)));
AddImmediateSetFlags(end_address, instance, instance_size);
b(failure, CS); // Fail on unsigned overflow.
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
// end_address: potential next object start.
- ldr(temp2, Address(THR, Thread::end_offset()));
+ ldr(temp2, Address(temp1, Heap::EndOffset(space)));
cmp(end_address, Operand(temp2));
b(failure, CS);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- str(end_address, Address(THR, Thread::top_offset()));
+ str(end_address, Address(temp1, Heap::TopOffset(space)));
add(instance, instance, Operand(kHeapObjectTag));
LoadImmediate(temp2, instance_size);
NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space));
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698