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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 1241863002: VM: Refactor allocation stats code and remove duplicate code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 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/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index a1dd725f0a521a12cbfb35cf06681c4e08a790c5..b605c5bbd5b6c599048f42a7476dfa1998d5cfb0 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -728,7 +728,7 @@ void StubCode::GeneratePatchableAllocateArrayStub(Assembler* assembler,
Heap* heap = isolate->heap();
const intptr_t cid = kArrayCid;
- Heap::Space space = heap->SpaceForAllocation(cid);
+ Heap::Space space = Heap::SpaceForAllocation(cid);
__ LoadImmediate(T3, heap->TopAddress(space));
__ lw(T0, Address(T3, 0)); // Potential new object start.
@@ -982,7 +982,6 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
__ Comment("AllocateContext");
if (FLAG_inline_alloc) {
Label slow_case;
- Heap* heap = Isolate::Current()->heap();
// First compute the rounded instance size.
// T1: number of context variables.
intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1;
@@ -997,9 +996,10 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
// T1: number of context variables.
// T2: object size.
const intptr_t cid = kContextCid;
- Heap::Space space = heap->SpaceForAllocation(cid);
- __ LoadImmediate(T5, heap->TopAddress(space));
- __ lw(V0, Address(T5, 0));
+ Heap::Space space = Heap::SpaceForAllocation(cid);
+ __ LoadIsolate(T5);
+ __ lw(T5, Address(T5, Isolate::heap_offset()));
+ __ lw(V0, Address(T5, Heap::TopOffset(space)));
__ addu(T3, T2, V0);
// Check if the allocation fits into the remaining space.
@@ -1007,8 +1007,8 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
// T1: number of context variables.
// T2: object size.
// T3: potential next object start.
- __ LoadImmediate(TMP, heap->EndAddress(space));
- __ lw(CMPRES1, Address(TMP, 0));
+ // T5: heap.
+ __ lw(CMPRES1, Address(T5, Heap::EndOffset(space)));
if (FLAG_use_slow_path) {
__ b(&slow_case);
} else {
@@ -1021,9 +1021,11 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
// T1: number of context variables.
// T2: object size.
// T3: next object start.
- __ sw(T3, Address(T5, 0));
+ // T5: heap.
+ __ sw(T3, Address(T5, Heap::TopOffset(space)));
__ addiu(V0, V0, Immediate(kHeapObjectTag));
- __ UpdateAllocationStatsWithSize(cid, T2, T5, space);
+ __ UpdateAllocationStatsWithSize(cid, T2, T5, space,
+ /* inline_isolate = */ false);
// Calculate the size tag.
// V0: new object.
@@ -1191,7 +1193,7 @@ void StubCode::GenerateAllocationStubForClass(
// next object start and initialize the allocated object.
// T1: instantiated type arguments (if is_cls_parameterized).
Heap* heap = Isolate::Current()->heap();
- Heap::Space space = heap->SpaceForAllocation(cls.id());
+ Heap::Space space = Heap::SpaceForAllocation(cls.id());
__ LoadImmediate(T5, heap->TopAddress(space));
__ lw(T2, Address(T5));
__ LoadImmediate(T4, instance_size);
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698