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

Unified Diff: runtime/vm/heap.cc

Issue 16853006: Object histogramin the vm (--print-object-histogram). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 23950)
+++ runtime/vm/heap.cc (working copy)
@@ -7,6 +7,7 @@
#include "platform/assert.h"
#include "platform/utils.h"
#include "vm/flags.h"
+#include "vm/heap_histogram.h"
#include "vm/heap_profiler.h"
#include "vm/isolate.h"
#include "vm/object.h"
@@ -162,6 +163,7 @@
old_space_->MarkSweep(invoke_api_callbacks);
RecordAfterGC();
PrintStats();
+ UpdateObjectHistogram();
break;
}
default:
@@ -170,6 +172,13 @@
}
+void Heap::UpdateObjectHistogram() {
+ Isolate* isolate = Isolate::Current();
+ if (isolate->object_histogram() == NULL) return;
+ isolate->object_histogram()->Collect();
+}
+
+
void Heap::CollectGarbage(Space space) {
ApiCallbacks api_callbacks;
if (space == kOld) {
@@ -190,6 +199,7 @@
old_space_->MarkSweep(kInvokeApiCallbacks);
RecordAfterGC();
PrintStats();
+ UpdateObjectHistogram();
}
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698