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

Unified Diff: runtime/vm/class_table.cc

Issue 487973002: Track per-class promotion stats. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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/class_table.h ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_table.cc
===================================================================
--- runtime/vm/class_table.cc (revision 39414)
+++ runtime/vm/class_table.cc (working copy)
@@ -193,6 +193,8 @@
recent.Reset();
accumulated.Reset();
last_reset.Reset();
+ promoted_count = 0;
+ promoted_size = 0;
}
@@ -205,6 +207,8 @@
last_reset.ResetNew();
post_gc.ResetNew();
recent.ResetNew();
+ old_pre_new_gc_count_ = recent.old_count;
+ old_pre_new_gc_size_ = recent.old_size;
}
@@ -226,6 +230,8 @@
recent.UpdateSize(instance_size);
accumulated.UpdateSize(instance_size);
last_reset.UpdateSize(instance_size);
+ promoted_size = promoted_count * instance_size;
+ old_pre_new_gc_size_ = old_pre_new_gc_count_ * instance_size;
}
@@ -240,6 +246,12 @@
}
+void ClassHeapStats::UpdatePromotedAfterNewGC() {
+ promoted_count = recent.old_count - old_pre_new_gc_count_;
+ promoted_size = recent.old_size - old_pre_new_gc_size_;
+}
+
+
void ClassHeapStats::PrintToJSONObject(const Class& cls,
JSONObject* obj) const {
obj->AddProperty("type", "ClassHeapStats");
@@ -271,6 +283,8 @@
old_stats.AddValue64(accumulated.old_size + recent.old_size -
last_reset.old_size);
}
+ obj->AddProperty("promotedInstances", promoted_count);
+ obj->AddProperty("promotedBytes", promoted_size);
}
@@ -342,6 +356,16 @@
}
+void ClassTable::UpdatePromoted() {
+ for (intptr_t i = 0; i < kNumPredefinedCids; i++) {
+ predefined_class_heap_stats_table_[i].UpdatePromotedAfterNewGC();
+ }
+ for (intptr_t i = kNumPredefinedCids; i < top_; i++) {
+ class_heap_stats_table_[i].UpdatePromotedAfterNewGC();
+ }
+}
+
+
void ClassTable::AllocationProfilePrintJSON(JSONStream* stream) {
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL);
« no previous file with comments | « runtime/vm/class_table.h ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698