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

Unified Diff: runtime/vm/intrinsifier_arm64.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/intrinsifier_arm64.cc
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index 80d51eb3e4c0c564710339473e61c281d61f3275..aff4989a228890fecc35fe2b19248328c8e08525 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -201,8 +201,7 @@ static int GetScaleFactor(intptr_t size) {
__ AddImmediate(R2, fixed_size_plus_alignment_padding); \
__ andi(R2, R2, Immediate(~(kObjectAlignment - 1))); \
Heap::Space space = Heap::kNew; \
- __ ldr(R3, Address(THR, Thread::heap_offset())); \
- __ ldr(R0, Address(R3, Heap::TopOffset(space))); \
+ __ ldr(R0, Address(THR, Thread::top_offset())); \
\
/* R2: allocation size. */ \
__ adds(R1, R0, Operand(R2)); \
@@ -213,13 +212,13 @@ static int GetScaleFactor(intptr_t size) {
/* R1: potential next object start. */ \
/* R2: allocation size. */ \
/* R3: heap. */ \
- __ ldr(R6, Address(R3, Heap::EndOffset(space))); \
+ __ ldr(R6, Address(THR, Thread::end_offset())); \
__ cmp(R1, Operand(R6)); \
__ b(&fall_through, CS); \
\
/* Successfully allocated the object(s), now update top to point to */ \
/* next object start and initialize the object. */ \
- __ str(R1, Address(R3, Heap::TopOffset(space))); \
+ __ str(R1, Address(THR, Thread::top_offset())); \
__ AddImmediate(R0, kHeapObjectTag); \
NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, R2, space)); \
/* Initialize the tags. */ \
@@ -2079,8 +2078,7 @@ static void TryAllocateOnebyteString(Assembler* assembler,
const intptr_t cid = kOneByteStringCid;
Heap::Space space = Heap::kNew;
- __ ldr(R3, Address(THR, Thread::heap_offset()));
- __ ldr(R0, Address(R3, Heap::TopOffset(space)));
+ __ ldr(R0, Address(THR, Thread::top_offset()));
// length_reg: allocation size.
__ adds(R1, R0, Operand(length_reg));
@@ -2091,13 +2089,13 @@ static void TryAllocateOnebyteString(Assembler* assembler,
// R1: potential next object start.
// R2: allocation size.
// R3: heap.
- __ ldr(R7, Address(R3, Heap::EndOffset(space)));
+ __ ldr(R7, Address(THR, Thread::end_offset()));
__ cmp(R1, Operand(R7));
__ b(&fail, CS);
// Successfully allocated the object(s), now update top to point to
// next object start and initialize the object.
- __ str(R1, Address(R3, Heap::TopOffset(space)));
+ __ str(R1, Address(THR, Thread::top_offset()));
__ AddImmediate(R0, kHeapObjectTag);
NOT_IN_PRODUCT(__ UpdateAllocationStatsWithSize(cid, R2, space));

Powered by Google App Engine
This is Rietveld 408576698