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

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: Added methods to surface number of zone and scoped handles in each isolate. These values are displa… 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
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 }
774 ASSERT(count >= 0);
775 return count;
776 }
777
778
779 intptr_t Thread::CountScopedHandles() const {
780 intptr_t count = 0;
781 Zone* zone = zone_;
782 while (zone != NULL) {
783 count += zone->handles()->CountScopedHandles();
784 zone = zone->previous();
785 }
786 ASSERT(count >= 0);
787 return count;
788 }
789
790
767 int Thread::ZoneSizeInBytes() const { 791 int Thread::ZoneSizeInBytes() const {
768 int total = 0; 792 int total = 0;
769 ApiLocalScope* scope = api_top_scope_; 793 ApiLocalScope* scope = api_top_scope_;
770 while (scope != NULL) { 794 while (scope != NULL) {
771 total += scope->zone()->SizeInBytes(); 795 total += scope->zone()->SizeInBytes();
772 scope = scope->previous(); 796 scope = scope->previous();
773 } 797 }
774 return total; 798 return total;
775 } 799 }
776 800
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 839
816 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 840 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
817 if (thread() != NULL) { 841 if (thread() != NULL) {
818 OSThread* os_thread = thread()->os_thread(); 842 OSThread* os_thread = thread()->os_thread();
819 ASSERT(os_thread != NULL); 843 ASSERT(os_thread != NULL);
820 os_thread->EnableThreadInterrupts(); 844 os_thread->EnableThreadInterrupts();
821 } 845 }
822 } 846 }
823 847
824 } // namespace dart 848 } // namespace dart
OLDNEW
« 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