Chromium Code Reviews| 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_; |