Index: runtime/vm/stub_code_mips.cc |
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc |
index 33437e48c5adaab562e2610b944bcf6979ae6b9f..7968f619ef73590e322691b62018570c02aac382 100644 |
--- a/runtime/vm/stub_code_mips.cc |
+++ b/runtime/vm/stub_code_mips.cc |
@@ -713,6 +713,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. |
@@ -1115,6 +1118,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. |
@@ -1397,6 +1401,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(); |
@@ -1486,6 +1491,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). |