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

Side by Side Diff: runtime/vm/thread.cc

Issue 2601153002: Added methods to surface number of zone and scoped handles for each isolate. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/thread.h" 5 #include "vm/thread.h"
6 6
7 #include "vm/compiler_stats.h" 7 #include "vm/compiler_stats.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 while (scope != NULL) { 746 while (scope != NULL) {
747 if (scope->local_handles()->IsValidHandle(object)) { 747 if (scope->local_handles()->IsValidHandle(object)) {
748 return true; 748 return true;
749 } 749 }
750 scope = scope->previous(); 750 scope = scope->previous();
751 } 751 }
752 return false; 752 return false;
753 } 753 }
754 754
755 755
756 int Thread::CountLocalHandles() const { 756 intptr_t Thread::CountLocalHandles() const {
757 int total = 0; 757 intptr_t total = 0;
758 ApiLocalScope* scope = api_top_scope_; 758 ApiLocalScope* scope = api_top_scope_;
759 while (scope != NULL) { 759 while (scope != NULL) {
760 total += scope->local_handles()->CountHandles(); 760 total += scope->local_handles()->CountHandles();
761 scope = scope->previous(); 761 scope = scope->previous();
762 } 762 }
763 return total; 763 return total;
764 } 764 }
765 765
766 766
767 intptr_t Thread::CountZoneHandles() const {
768 intptr_t count = 0;
769 Zone* zone = zone_;
770 while (zone != NULL) {
771 count += zone->handles()->CountZoneHandles();
772 zone = zone->previous();
773 }
siva 2017/01/03 20:08:31 ASSERT(count > 0);
774 return count;
775 }
776
777
778 intptr_t Thread::CountScopedHandles() const {
779 intptr_t count = 0;
780 Zone* zone = zone_;
781 while (zone != NULL) {
782 count += zone->handles()->CountScopedHandles();
783 zone = zone->previous();
784 }
siva 2017/01/03 20:08:31 ASSERT(count > 0);
785 return count;
786 }
787
788
767 int Thread::ZoneSizeInBytes() const { 789 int Thread::ZoneSizeInBytes() const {
768 int total = 0; 790 int total = 0;
769 ApiLocalScope* scope = api_top_scope_; 791 ApiLocalScope* scope = api_top_scope_;
770 while (scope != NULL) { 792 while (scope != NULL) {
771 total += scope->zone()->SizeInBytes(); 793 total += scope->zone()->SizeInBytes();
772 scope = scope->previous(); 794 scope = scope->previous();
773 } 795 }
774 return total; 796 return total;
775 } 797 }
776 798
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 837
816 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 838 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
817 if (thread() != NULL) { 839 if (thread() != NULL) {
818 OSThread* os_thread = thread()->os_thread(); 840 OSThread* os_thread = thread()->os_thread();
819 ASSERT(os_thread != NULL); 841 ASSERT(os_thread != NULL);
820 os_thread->EnableThreadInterrupts(); 842 os_thread->EnableThreadInterrupts();
821 } 843 }
822 } 844 }
823 845
824 } // namespace dart 846 } // namespace dart
OLDNEW
« 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