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

Unified Diff: runtime/vm/thread.cc

Issue 2601153002: Added methods to surface number of zone and scoped handles for each isolate. (Closed)
Patch Set: Created 4 years 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/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 1b3428eaa62eba6a88e01859b9b294528db1cce3..d0920b81b1226e66deb496cdf0cfc288518a1baf 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -753,8 +753,8 @@ bool Thread::IsValidLocalHandle(Dart_Handle object) const {
}
-int Thread::CountLocalHandles() const {
- int total = 0;
+intptr_t Thread::CountLocalHandles() const {
+ intptr_t total = 0;
ApiLocalScope* scope = api_top_scope_;
while (scope != NULL) {
total += scope->local_handles()->CountHandles();
@@ -764,6 +764,28 @@ int Thread::CountLocalHandles() const {
}
+intptr_t Thread::CountZoneHandles() const {
+ intptr_t count = 0;
+ Zone* zone = zone_;
+ while (zone != NULL) {
+ count += zone->handles()->CountZoneHandles();
+ zone = zone->previous();
+ }
siva 2017/01/03 20:08:31 ASSERT(count > 0);
+ return count;
+}
+
+
+intptr_t Thread::CountScopedHandles() const {
+ intptr_t count = 0;
+ Zone* zone = zone_;
+ while (zone != NULL) {
+ count += zone->handles()->CountScopedHandles();
+ zone = zone->previous();
+ }
siva 2017/01/03 20:08:31 ASSERT(count > 0);
+ return count;
+}
+
+
int Thread::ZoneSizeInBytes() const {
int total = 0;
ApiLocalScope* scope = api_top_scope_;
« runtime/vm/isolate.cc ('K') | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698