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

Unified Diff: runtime/vm/stub_code_arm.cc

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/stub_code_arm.cc
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 06e9353de914f802dfa78413ad9a9b8fdd1a6146..0ca8b0da40de22a009729f00e757e09541b241e4 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -598,10 +598,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));
+ __ BumpAllocationCount(Heap::kNew, kArrayCid, R3, R8);
// R0: new object start as a tagged pointer.
// R1: array element type.
@@ -934,6 +936,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
// R3: next object start.
__ str(R3, Address(R5, 0));
__ add(R0, R0, ShifterOperand(kHeapObjectTag));
+ __ BumpAllocationCount(Heap::kNew, context_class.id(), R2, R5);
// Calculate the size tag.
// R0: new object.
@@ -1116,6 +1119,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));
+ __ BumpAllocationCount(Heap::kNew, cls.id(), R5);
if (is_cls_parameterized) {
// Initialize the type arguments field in the object.
@@ -1280,7 +1284,9 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
// Successfully allocated the object, now update top to point to
// next object start and initialize the object.
__ str(R3, Address(R5, 0));
-
+ // R3: Size of allocation in bytes.
+ __ sub(R3, R3, ShifterOperand(R2));
+ __ BumpAllocationCount(Heap::kNew, cls.id(), R3, R5);
// R2: new closure object.
// R4: new context object (only if is_implicit_closure).
// Set the tags.

Powered by Google App Engine
This is Rietveld 408576698