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

Unified Diff: runtime/vm/thread.cc

Issue 2601153002: Added methods to surface number of zone and scoped handles for each isolate. (Closed)
Patch Set: Added methods to surface number of zone and scoped handles in each isolate. These values are displa… Created 3 years, 12 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/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 1b3428eaa62eba6a88e01859b9b294528db1cce3..e9381014d894ee75b400597a3994e6d3937bc1fd 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,30 @@ 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();
+ }
+ 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();
+ }
+ ASSERT(count >= 0);
+ return count;
+}
+
+
int Thread::ZoneSizeInBytes() const {
int total = 0;
ApiLocalScope* scope = api_top_scope_;
« no previous file with comments | « 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