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

Unified Diff: runtime/vm/intrinsifier_arm64.cc

Issue 1263513002: VM: Load allocation-top and -end via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed cc tests Created 5 years, 4 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 18eb6752003efee6b9edf82b8e17579d3c2e829c..4d27700a140de2c6fdde1e4cc62bb8d3e1110be8 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -198,7 +198,8 @@ static int GetScaleFactor(intptr_t size) {
#define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_shift) \
Label fall_through; \
const intptr_t kArrayLengthStackOffset = 0 * kWordSize; \
- __ MaybeTraceAllocation(cid, R2, &fall_through); \
+ __ MaybeTraceAllocation(cid, R2, &fall_through, \
+ /* inline_isolate = */ false); \
__ ldr(R2, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \
/* Check that length is a positive Smi. */ \
/* R2: requested array length argument. */ \
@@ -215,10 +216,9 @@ static int GetScaleFactor(intptr_t size) {
const intptr_t fixed_size = sizeof(Raw##type_name) + kObjectAlignment - 1; \
__ AddImmediate(R2, R2, fixed_size); \
__ andi(R2, R2, Immediate(~(kObjectAlignment - 1))); \
- Heap* heap = Isolate::Current()->heap(); \
- Heap::Space space = heap->SpaceForAllocation(cid); \
- __ LoadImmediate(R0, heap->TopAddress(space)); \
- __ ldr(R0, Address(R0, 0)); \
+ Heap::Space space = Heap::SpaceForAllocation(cid); \
+ __ ldr(R3, Address(THR, Thread::heap_offset())); \
+ __ ldr(R0, Address(R3, Heap::TopOffset(space))); \
\
/* R2: allocation size. */ \
__ adds(R1, R0, Operand(R2)); \
@@ -228,17 +228,17 @@ static int GetScaleFactor(intptr_t size) {
/* R0: potential new object start. */ \
/* R1: potential next object start. */ \
/* R2: allocation size. */ \
- __ LoadImmediate(R3, heap->EndAddress(space)); \
- __ ldr(R3, Address(R3, 0)); \
- __ cmp(R1, Operand(R3)); \
+ /* R3: heap. */ \
+ __ ldr(R4, Address(R3, Heap::EndOffset(space))); \
+ __ cmp(R1, Operand(R4)); \
__ b(&fall_through, CS); \
\
/* Successfully allocated the object(s), now update top to point to */ \
/* next object start and initialize the object. */ \
- __ LoadImmediate(R3, heap->TopAddress(space)); \
- __ str(R1, Address(R3, 0)); \
+ __ str(R1, Address(R3, Heap::TopOffset(space))); \
__ AddImmediate(R0, R0, kHeapObjectTag); \
- __ UpdateAllocationStatsWithSize(cid, R2, space); \
+ __ UpdateAllocationStatsWithSize(cid, R2, space, \
+ /* inline_isolate = */ false); \
/* Initialize the tags. */ \
/* R0: new object start as a tagged pointer. */ \
/* R1: new object end address. */ \
@@ -1849,7 +1849,8 @@ static void TryAllocateOnebyteString(Assembler* assembler,
Label* failure) {
const Register length_reg = R2;
Label fail;
- __ MaybeTraceAllocation(kOneByteStringCid, R0, failure);
+ __ MaybeTraceAllocation(kOneByteStringCid, R0, failure,
+ /* inline_isolate = */ false);
__ mov(R6, length_reg); // Save the length register.
// TODO(koda): Protect against negative length and overflow here.
__ SmiUntag(length_reg);
@@ -1857,12 +1858,10 @@ static void TryAllocateOnebyteString(Assembler* assembler,
__ AddImmediate(length_reg, length_reg, fixed_size);
__ andi(length_reg, length_reg, Immediate(~(kObjectAlignment - 1)));
- Isolate* isolate = Isolate::Current();
- Heap* heap = isolate->heap();
const intptr_t cid = kOneByteStringCid;
- Heap::Space space = heap->SpaceForAllocation(cid);
- __ LoadImmediate(R3, heap->TopAddress(space));
- __ ldr(R0, Address(R3));
+ Heap::Space space = Heap::SpaceForAllocation(cid);
+ __ ldr(R3, Address(THR, Thread::heap_offset()));
+ __ ldr(R0, Address(R3, Heap::TopOffset(space)));
// length_reg: allocation size.
__ adds(R1, R0, Operand(length_reg));
@@ -1872,17 +1871,17 @@ static void TryAllocateOnebyteString(Assembler* assembler,
// R0: potential new object start.
// R1: potential next object start.
// R2: allocation size.
- // R3: heap->TopAddress(space).
- __ LoadImmediate(R7, heap->EndAddress(space));
- __ ldr(R7, Address(R7));
+ // R3: heap.
+ __ ldr(R7, Address(R3, Heap::EndOffset(space)));
__ 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));
+ __ str(R1, Address(R3, Heap::TopOffset(space)));
__ AddImmediate(R0, R0, kHeapObjectTag);
- __ UpdateAllocationStatsWithSize(cid, R2, space);
+ __ UpdateAllocationStatsWithSize(cid, R2, space,
+ /* inline_isolate = */ false);
// Initialize the tags.
// R0: new object start as a tagged pointer.

Powered by Google App Engine
This is Rietveld 408576698