Index: runtime/vm/stub_code_mips.cc |
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc |
index dbec240dac8d160d7b70a6673285e8519b90a5f8..5a5e5e5d80ad93a36aa8c1dedc8e2f471eda8d2e 100644 |
--- a/runtime/vm/stub_code_mips.cc |
+++ b/runtime/vm/stub_code_mips.cc |
@@ -700,6 +700,9 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { |
// T0: Points to new space object. |
__ sw(T2, Address(T0, Scavenger::top_offset())); |
__ addiu(V0, V0, Immediate(kHeapObjectTag)); |
+ // T1: Size of allocation in bytes. |
+ __ subu(T1, T2, V0); |
+ __ UpdateAllocationStatsWithSize(kArrayCid, T1, T5); |
// V0: new object start as a tagged pointer. |
// A0: array element type. |
@@ -1102,6 +1105,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
// T3: next object start. |
__ sw(T3, Address(T5, 0)); |
__ addiu(V0, V0, Immediate(kHeapObjectTag)); |
+ __ UpdateAllocationStatsWithSize(context_class.id(), T2, T5); |
// Calculate the size tag. |
// V0: new object. |
@@ -1384,6 +1388,7 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
// Set the type arguments in the new object. |
__ sw(T1, Address(T2, cls.type_arguments_field_offset())); |
} |
+ __ UpdateAllocationStats(cls.id(), T5); |
// Done allocating and initializing the instance. |
// T2: new object still missing its heap tag. |
__ Ret(); |
@@ -1473,6 +1478,9 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler, |
// Successfully allocated the object, now update top to point to |
// next object start and initialize the object. |
__ sw(T3, Address(T5)); |
+ // T3: Size of allocation in bytes. |
+ __ subu(T3, T3, T2); |
+ __ UpdateAllocationStatsWithSize(cls.id(), T3, T5); |
// T2: new closure object. |
// T4: new context object (only if is_implicit_closure). |