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

Unified Diff: runtime/vm/pages.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 6 years, 11 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/pages.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 06f15b31e3c6951d9f4ea5532f14ce8aa61cced1..d5fc8ecaad7c3744c2865a17bd6db6ff3867083a 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -131,7 +131,9 @@ PageSpace::PageSpace(Heap* heap, intptr_t max_capacity_in_words)
sweeping_(false),
page_space_controller_(FLAG_heap_growth_space_ratio,
FLAG_heap_growth_rate,
- FLAG_heap_growth_time_ratio) {
+ FLAG_heap_growth_time_ratio),
+ gc_time_micros_(0),
+ collections_(0) {
}
@@ -391,6 +393,19 @@ void PageSpace::WriteProtect(bool read_only) {
}
+void PageSpace::PrintToJSONObject(JSONObject* object) {
+ JSONObject space(object, "old");
+ space.AddProperty("type", "PageSpace");
+ space.AddProperty("id", "heaps/old");
+ space.AddProperty("name", "PageSpace");
+ space.AddProperty("user_name", "old");
+ space.AddProperty("collections", collections());
+ space.AddProperty("used", UsedInWords() * kWordSize);
+ space.AddProperty("capacity", CapacityInWords() * kWordSize);
+ space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros()));
+}
+
+
bool PageSpace::ShouldCollectCode() {
// Try to collect code if enough time has passed since the last attempt.
const int64_t start = OS::GetCurrentTimeMicros();
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698