OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #ifndef VM_ISOLATE_H_ | 5 #ifndef VM_ISOLATE_H_ |
6 #define VM_ISOLATE_H_ | 6 #define VM_ISOLATE_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return mutator_thread_ != NULL; | 163 return mutator_thread_ != NULL; |
164 } | 164 } |
165 bool MutatorThreadIsCurrentThread() { | 165 bool MutatorThreadIsCurrentThread() { |
166 return mutator_thread_ == Thread::Current(); | 166 return mutator_thread_ == Thread::Current(); |
167 } | 167 } |
168 | 168 |
169 const char* name() const { return name_; } | 169 const char* name() const { return name_; } |
170 const char* debugger_name() const { return debugger_name_; } | 170 const char* debugger_name() const { return debugger_name_; } |
171 void set_debugger_name(const char* name); | 171 void set_debugger_name(const char* name); |
172 | 172 |
173 // TODO(koda): Move to Thread. | |
174 class Log* Log() const; | |
175 | |
176 int64_t start_time() const { return start_time_; } | 173 int64_t start_time() const { return start_time_; } |
177 | 174 |
178 Dart_Port main_port() const { return main_port_; } | 175 Dart_Port main_port() const { return main_port_; } |
179 void set_main_port(Dart_Port port) { | 176 void set_main_port(Dart_Port port) { |
180 ASSERT(main_port_ == 0); // Only set main port once. | 177 ASSERT(main_port_ == 0); // Only set main port once. |
181 main_port_ = port; | 178 main_port_ = port; |
182 } | 179 } |
183 Dart_Port origin_id() const { return origin_id_; } | 180 Dart_Port origin_id() const { return origin_id_; } |
184 void set_origin_id(Dart_Port id) { | 181 void set_origin_id(Dart_Port id) { |
185 ASSERT((id == main_port_ && origin_id_ == 0) || | 182 ASSERT((id == main_port_ && origin_id_ == 0) || |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 // to using the mutator thread (which must also be the current thread). | 749 // to using the mutator thread (which must also be the current thread). |
753 Zone* current_zone() const { | 750 Zone* current_zone() const { |
754 ASSERT(Thread::Current() == mutator_thread_); | 751 ASSERT(Thread::Current() == mutator_thread_); |
755 return mutator_thread_->zone(); | 752 return mutator_thread_->zone(); |
756 } | 753 } |
757 void set_current_zone(Zone* zone) { | 754 void set_current_zone(Zone* zone) { |
758 ASSERT(Thread::Current() == mutator_thread_); | 755 ASSERT(Thread::Current() == mutator_thread_); |
759 mutator_thread_->set_zone(zone); | 756 mutator_thread_->set_zone(zone); |
760 } | 757 } |
761 | 758 |
| 759 bool is_service_isolate() const { return is_service_isolate_; } |
| 760 |
762 private: | 761 private: |
763 friend class Dart; // Init, InitOnce, Shutdown. | 762 friend class Dart; // Init, InitOnce, Shutdown. |
764 | 763 |
765 explicit Isolate(const Dart_IsolateFlags& api_flags); | 764 explicit Isolate(const Dart_IsolateFlags& api_flags); |
766 | 765 |
767 static void InitOnce(); | 766 static void InitOnce(); |
768 static Isolate* Init(const char* name_prefix, | 767 static Isolate* Init(const char* name_prefix, |
769 const Dart_IsolateFlags& api_flags, | 768 const Dart_IsolateFlags& api_flags, |
770 bool is_vm_isolate = false); | 769 bool is_vm_isolate = false); |
771 void Shutdown(); | 770 void Shutdown(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 IsolateSpawnState* spawn_state_; | 850 IsolateSpawnState* spawn_state_; |
852 bool is_runnable_; | 851 bool is_runnable_; |
853 Dart_GcPrologueCallback gc_prologue_callback_; | 852 Dart_GcPrologueCallback gc_prologue_callback_; |
854 Dart_GcEpilogueCallback gc_epilogue_callback_; | 853 Dart_GcEpilogueCallback gc_epilogue_callback_; |
855 intptr_t defer_finalization_count_; | 854 intptr_t defer_finalization_count_; |
856 DeoptContext* deopt_context_; | 855 DeoptContext* deopt_context_; |
857 int32_t edge_counter_increment_size_; | 856 int32_t edge_counter_increment_size_; |
858 | 857 |
859 CompilerStats* compiler_stats_; | 858 CompilerStats* compiler_stats_; |
860 | 859 |
861 // Log. | |
862 bool is_service_isolate_; | 860 bool is_service_isolate_; |
863 class Log* log_; | |
864 | 861 |
865 // Status support. | 862 // Status support. |
866 char* stacktrace_; | 863 char* stacktrace_; |
867 intptr_t stack_frame_index_; | 864 intptr_t stack_frame_index_; |
868 | 865 |
869 // Timestamps of last operation via service. | 866 // Timestamps of last operation via service. |
870 int64_t last_allocationprofile_accumulator_reset_timestamp_; | 867 int64_t last_allocationprofile_accumulator_reset_timestamp_; |
871 int64_t last_allocationprofile_gc_timestamp_; | 868 int64_t last_allocationprofile_gc_timestamp_; |
872 | 869 |
873 // Ring buffer of objects assigned an id. | 870 // Ring buffer of objects assigned an id. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 uint8_t* serialized_message_; | 1118 uint8_t* serialized_message_; |
1122 intptr_t serialized_message_len_; | 1119 intptr_t serialized_message_len_; |
1123 Isolate::Flags isolate_flags_; | 1120 Isolate::Flags isolate_flags_; |
1124 bool paused_; | 1121 bool paused_; |
1125 bool errors_are_fatal_; | 1122 bool errors_are_fatal_; |
1126 }; | 1123 }; |
1127 | 1124 |
1128 } // namespace dart | 1125 } // namespace dart |
1129 | 1126 |
1130 #endif // VM_ISOLATE_H_ | 1127 #endif // VM_ISOLATE_H_ |
OLD | NEW |