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

Unified Diff: runtime/vm/intrinsifier_x64.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/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index 2a2fb164e0a05f888e3b5bf784d0b26b15a08b96..daaf9492effe5b8632c0a025ea7ad83730dc60da 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -78,7 +78,7 @@ void Intrinsifier::List_Allocate(Assembler* assembler) {
__ movq(R13, Immediate(heap->TopAddress()));
__ movq(Address(R13, 0), RCX);
__ addq(RAX, Immediate(kHeapObjectTag));
-
+ __ BumpAllocationCount(Heap::kNew, kArrayCid, RDI);
// Initialize the tags.
// RAX: new object start as a tagged pointer.
// RDI: allocation size.
@@ -259,6 +259,7 @@ void Intrinsifier::GrowableList_Allocate(Assembler* assembler) {
// Set the length field in the growable array object to 0.
__ movq(FieldAddress(RAX, GrowableObjectArray::length_offset()),
Immediate(0));
+ __ BumpAllocationCount(Heap::kNew, kGrowableObjectArrayCid);
__ ret(); // returns the newly allocated object in RAX.
__ Bind(&fall_through);
@@ -446,7 +447,7 @@ void Intrinsifier::GrowableList_add(Assembler* assembler) {
__ movq(R13, Immediate(heap->TopAddress())); \
__ movq(Address(R13, 0), RCX); \
__ addq(RAX, Immediate(kHeapObjectTag)); \
- \
+ __ BumpAllocationCount(Heap::kNew, cid, RDI); \
/* Initialize the tags. */ \
/* RAX: new object start as a tagged pointer. */ \
/* RCX: new object end address. */ \
@@ -490,7 +491,6 @@ void Intrinsifier::GrowableList_add(Assembler* assembler) {
__ addq(RDI, Immediate(kWordSize)); \
__ jmp(&init_loop, Assembler::kNearJump); \
__ Bind(&done); \
- \
__ ret(); \
__ Bind(&fall_through); \
@@ -1524,6 +1524,7 @@ static void TryAllocateOnebyteString(Assembler* assembler,
__ movq(R13, Immediate(heap->TopAddress()));
__ movq(Address(R13, 0), RCX);
__ addq(RAX, Immediate(kHeapObjectTag));
+ __ BumpAllocationCount(Heap::kNew, kOneByteStringCid, RDI);
// Initialize the tags.
// RAX: new object start as a tagged pointer.

Powered by Google App Engine
This is Rietveld 408576698