Index: runtime/vm/stub_code_arm.cc |
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc |
index 7857b2bb8ae8a61f026b8e083aeb2b978c81f279..c65ccc7d7ee8bb133cc77396bfc72fa2571f84b6 100644 |
--- a/runtime/vm/stub_code_arm.cc |
+++ b/runtime/vm/stub_code_arm.cc |
@@ -623,10 +623,12 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { |
// Successfully allocated the object(s), now update top to point to |
// next object start and initialize the object. |
// R0: potential new object start. |
+ // R3: array size. |
// R7: potential next object start. |
// R8: Points to new space object. |
__ StoreToOffset(kWord, R7, R8, Scavenger::top_offset()); |
__ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
+ __ UpdateAllocationStatsWithSize(kArrayCid, R3, R8); |
// R0: new object start as a tagged pointer. |
// R1: array element type. |
@@ -959,6 +961,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
// R3: next object start. |
__ str(R3, Address(R5, 0)); |
__ add(R0, R0, ShifterOperand(kHeapObjectTag)); |
+ __ UpdateAllocationStatsWithSize(context_class.id(), R2, R5); |
// Calculate the size tag. |
// R0: new object. |
@@ -1141,6 +1144,7 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
// Successfully allocated the object(s), now update top to point to |
// next object start and initialize the object. |
__ str(R3, Address(R5, 0)); |
+ __ UpdateAllocationStats(cls.id(), R5); |
if (is_cls_parameterized) { |
// Initialize the type arguments field in the object. |
@@ -1306,6 +1310,17 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler, |
// next object start and initialize the object. |
__ str(R3, Address(R5, 0)); |
+ if (is_implicit_instance_closure) { |
+ // This closure allocates a context, update allocation stats. |
+ // R3: context size. |
+ __ LoadImmediate(R3, context_size); |
+ // R5: Clobbered. |
+ __ UpdateAllocationStatsWithSize(kContextCid, R3, R5); |
+ } |
+ // The closure allocation is attributed to the signature class. |
+ // R5: Will be clobbered. |
+ __ UpdateAllocationStats(cls.id(), R5); |
+ |
// R2: new closure object. |
// R4: new context object (only if is_implicit_closure). |
// Set the tags. |