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

Unified Diff: runtime/vm/scavenger.h

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/raw_object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.h
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index 249df65d00540c739006d01f4125b35a2fe9c8cd..83e8a57586e2123d0f3f3e2d65f4628aece4155e 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -18,6 +18,7 @@ namespace dart {
// Forward declarations.
class Heap;
class Isolate;
+class JSONObject;
class ScavengerVisitor;
DECLARE_FLAG(bool, gc_at_alloc);
@@ -89,6 +90,24 @@ class Scavenger {
void WriteProtect(bool read_only);
+ void AddGCTime(int64_t micros) {
+ gc_time_micros_ += micros;
+ }
+
+ int64_t gc_time_micros() const {
+ return gc_time_micros_;
+ }
+
+ void IncrementCollections() {
+ collections_++;
+ }
+
+ intptr_t collections() const {
+ return collections_;
+ }
+
+ void PrintToJSONObject(JSONObject* object);
+
private:
// Ids for time and data records in Heap::GCStats.
enum {
@@ -172,6 +191,9 @@ class Scavenger {
// Keep track whether the scavenge had a promotion failure.
bool had_promotion_failure_;
+ int64_t gc_time_micros_;
+ intptr_t collections_;
+
friend class ScavengerVisitor;
friend class ScavengerWeakVisitor;
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698