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

Unified Diff: runtime/vm/heap.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, 2 months 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/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 8f6633ca93e5c6e7ab1f5369cf0b6b2ee52b28a7..acc941916350f096314ecd11402b4e46b24aa41c 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -7,6 +7,7 @@
#include "platform/assert.h"
#include "platform/utils.h"
#include "vm/flags.h"
+#include "vm/heap_class_stats.h"
#include "vm/heap_histogram.h"
#include "vm/heap_profiler.h"
#include "vm/isolate.h"
@@ -177,6 +178,7 @@ void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
RecordAfterGC();
PrintStats();
UpdateObjectHistogram();
+ UpdateHeapClassStats();
break;
}
default:
@@ -192,6 +194,15 @@ void Heap::UpdateObjectHistogram() {
}
+void Heap::UpdateHeapClassStats() {
+ Isolate* isolate = Isolate::Current();
+ if (isolate->heap_class_stats() == NULL) {
+ return;
+ }
+ isolate->heap_class_stats()->Collect();
+}
+
+
void Heap::CollectGarbage(Space space) {
ApiCallbacks api_callbacks;
if (space == kOld) {
@@ -213,6 +224,7 @@ void Heap::CollectAllGarbage() {
RecordAfterGC();
PrintStats();
UpdateObjectHistogram();
+ UpdateHeapClassStats();
}

Powered by Google App Engine
This is Rietveld 408576698