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

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

Issue 1841213003: Move CompilerStats from isolate to thread. Aggregate stats. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: review comments addressed Created 4 years, 8 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/timer.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/dart_api_state.h" 8 #include "vm/dart_api_state.h"
8 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
9 #include "vm/isolate.h" 10 #include "vm/isolate.h"
10 #include "vm/lockers.h" 11 #include "vm/lockers.h"
11 #include "vm/log.h" 12 #include "vm/log.h"
12 #include "vm/message_handler.h" 13 #include "vm/message_handler.h"
13 #include "vm/native_entry.h" 14 #include "vm/native_entry.h"
14 #include "vm/object.h" 15 #include "vm/object.h"
15 #include "vm/os_thread.h" 16 #include "vm/os_thread.h"
16 #include "vm/profiler.h" 17 #include "vm/profiler.h"
17 #include "vm/runtime_entry.h" 18 #include "vm/runtime_entry.h"
18 #include "vm/stub_code.h" 19 #include "vm/stub_code.h"
19 #include "vm/symbols.h" 20 #include "vm/symbols.h"
20 #include "vm/thread_interrupter.h" 21 #include "vm/thread_interrupter.h"
21 #include "vm/thread_registry.h" 22 #include "vm/thread_registry.h"
22 23
23 namespace dart { 24 namespace dart {
24 25
25 26
26 DECLARE_FLAG(bool, trace_service); 27 DECLARE_FLAG(bool, trace_service);
27 DECLARE_FLAG(bool, trace_service_verbose); 28 DECLARE_FLAG(bool, trace_service_verbose);
28 29
29 30
30 Thread::~Thread() { 31 Thread::~Thread() {
31 // We should cleanly exit any isolate before destruction. 32 // We should cleanly exit any isolate before destruction.
32 ASSERT(isolate_ == NULL); 33 ASSERT(isolate_ == NULL);
34 if (compiler_stats_ != NULL) {
35 delete compiler_stats_;
36 compiler_stats_ = NULL;
37 }
33 // There should be no top api scopes at this point. 38 // There should be no top api scopes at this point.
34 ASSERT(api_top_scope() == NULL); 39 ASSERT(api_top_scope() == NULL);
35 // Delete the resusable api scope if there is one. 40 // Delete the resusable api scope if there is one.
36 if (api_reusable_scope_) { 41 if (api_reusable_scope_) {
37 delete api_reusable_scope_; 42 delete api_reusable_scope_;
38 api_reusable_scope_ = NULL; 43 api_reusable_scope_ = NULL;
39 } 44 }
40 delete thread_lock_; 45 delete thread_lock_;
41 thread_lock_ = NULL; 46 thread_lock_ = NULL;
42 } 47 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #endif 83 #endif
79 reusable_handles_(), 84 reusable_handles_(),
80 saved_stack_limit_(0), 85 saved_stack_limit_(0),
81 deferred_interrupts_mask_(0), 86 deferred_interrupts_mask_(0),
82 deferred_interrupts_(0), 87 deferred_interrupts_(0),
83 stack_overflow_count_(0), 88 stack_overflow_count_(0),
84 cha_(NULL), 89 cha_(NULL),
85 deopt_id_(0), 90 deopt_id_(0),
86 pending_functions_(GrowableObjectArray::null()), 91 pending_functions_(GrowableObjectArray::null()),
87 sticky_error_(Error::null()), 92 sticky_error_(Error::null()),
93 compiler_stats_(NULL),
88 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) 94 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
89 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) 95 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
90 safepoint_state_(0), 96 safepoint_state_(0),
91 execution_state_(kThreadInVM), 97 execution_state_(kThreadInVM),
92 next_(NULL) { 98 next_(NULL) {
93 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \ 99 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \
94 member_name = default_init_value; 100 member_name = default_init_value;
95 CACHED_CONSTANTS_LIST(DEFAULT_INIT) 101 CACHED_CONSTANTS_LIST(DEFAULT_INIT)
96 #undef DEFAULT_INIT 102 #undef DEFAULT_INIT
97 103
98 #define DEFAULT_INIT(name) \ 104 #define DEFAULT_INIT(name) \
99 name##_entry_point_ = 0; 105 name##_entry_point_ = 0;
100 RUNTIME_ENTRY_LIST(DEFAULT_INIT) 106 RUNTIME_ENTRY_LIST(DEFAULT_INIT)
101 #undef DEFAULT_INIT 107 #undef DEFAULT_INIT
102 108
103 #define DEFAULT_INIT(returntype, name, ...) \ 109 #define DEFAULT_INIT(returntype, name, ...) \
104 name##_entry_point_ = 0; 110 name##_entry_point_ = 0;
105 LEAF_RUNTIME_ENTRY_LIST(DEFAULT_INIT) 111 LEAF_RUNTIME_ENTRY_LIST(DEFAULT_INIT)
106 #undef DEFAULT_INIT 112 #undef DEFAULT_INIT
107 113
108 // We cannot initialize the VM constants here for the vm isolate thread 114 // We cannot initialize the VM constants here for the vm isolate thread
109 // due to boot strapping issues. 115 // due to boot strapping issues.
110 if ((Dart::vm_isolate() != NULL) && (isolate != Dart::vm_isolate())) { 116 if ((Dart::vm_isolate() != NULL) && (isolate != Dart::vm_isolate())) {
111 InitVMConstants(); 117 InitVMConstants();
112 } 118 }
119
120 if (FLAG_support_compiler_stats) {
121 compiler_stats_ = new CompilerStats(isolate);
122 if (FLAG_compiler_benchmark) {
123 compiler_stats_->EnableBenchmark();
124 }
125 }
113 } 126 }
114 127
115 128
116 static const struct ALIGN16 { 129 static const struct ALIGN16 {
117 uint64_t a; 130 uint64_t a;
118 uint64_t b; 131 uint64_t b;
119 } double_negate_constant = 132 } double_negate_constant =
120 {0x8000000000000000LL, 0x8000000000000000LL}; 133 {0x8000000000000000LL, 0x8000000000000000LL};
121 134
122 static const struct ALIGN16 { 135 static const struct ALIGN16 {
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 723
711 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 724 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
712 if (thread() != NULL) { 725 if (thread() != NULL) {
713 OSThread* os_thread = thread()->os_thread(); 726 OSThread* os_thread = thread()->os_thread();
714 ASSERT(os_thread != NULL); 727 ASSERT(os_thread != NULL);
715 os_thread->EnableThreadInterrupts(); 728 os_thread->EnableThreadInterrupts();
716 } 729 }
717 } 730 }
718 731
719 } // namespace dart 732 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/timer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698