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

Unified Diff: runtime/vm/object.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 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/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 7c817e13af4005381536f2e88fe53628362d766c..dbaf80a0bb8d69cdb9b7b98dd6ca99b61a88bf4f 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1458,6 +1458,11 @@ RawObject* Object::Allocate(intptr_t cls_id,
Exceptions::Throw(exception);
UNREACHABLE();
}
+ if (space == Heap::kNew) {
+ isolate->class_table()->UpdateAllocatedNew(cls_id, size);
+ } else {
+ isolate->class_table()->UpdateAllocatedOld(cls_id, size);
+ }
NoGCScope no_gc;
InitializeObject(address, cls_id, size);
RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);

Powered by Google App Engine
This is Rietveld 408576698