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/base_isolate.h" | 10 #include "vm/base_isolate.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 const Dart_IsolateFlags& api_flags, | 126 const Dart_IsolateFlags& api_flags, |
127 bool is_vm_isolate = false); | 127 bool is_vm_isolate = false); |
128 void Shutdown(); | 128 void Shutdown(); |
129 | 129 |
130 // Register a newly introduced class. | 130 // Register a newly introduced class. |
131 void RegisterClass(const Class& cls); | 131 void RegisterClass(const Class& cls); |
132 void RegisterClassAt(intptr_t index, const Class& cls); | 132 void RegisterClassAt(intptr_t index, const Class& cls); |
133 void ValidateClassTable(); | 133 void ValidateClassTable(); |
134 | 134 |
135 // Visit all object pointers. | 135 // Visit all object pointers. |
136 void VisitObjectPointers(ObjectPointerVisitor* visitor, | 136 void IterateObjectPointers(ObjectPointerVisitor* visitor, |
137 bool visit_prologue_weak_persistent_handles, | 137 bool visit_prologue_weak_persistent_handles, |
138 bool validate_frames); | 138 bool validate_frames); |
139 | 139 |
140 // Visits weak object pointers. | 140 // Visits weak object pointers. |
141 void VisitWeakPersistentHandles(HandleVisitor* visitor, | 141 void VisitWeakPersistentHandles(HandleVisitor* visitor, |
142 bool visit_prologue_weak_persistent_handles); | 142 bool visit_prologue_weak_persistent_handles); |
143 void VisitPrologueWeakPersistentHandles(HandleVisitor* visitor); | 143 void VisitPrologueWeakPersistentHandles(HandleVisitor* visitor); |
144 | 144 |
145 StoreBuffer* store_buffer() { return store_buffer_; } | 145 StoreBuffer* store_buffer() { return store_buffer_; } |
146 | 146 |
147 ClassTable* class_table() { return &class_table_; } | 147 ClassTable* class_table() { return &class_table_; } |
148 static intptr_t class_table_offset() { | 148 static intptr_t class_table_offset() { |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 void PauseEventHandler(); | 720 void PauseEventHandler(); |
721 | 721 |
722 private: | 722 private: |
723 explicit Isolate(const Dart_IsolateFlags& api_flags); | 723 explicit Isolate(const Dart_IsolateFlags& api_flags); |
724 | 724 |
725 void BuildName(const char* name_prefix); | 725 void BuildName(const char* name_prefix); |
726 void PrintInvokedFunctions(); | 726 void PrintInvokedFunctions(); |
727 | 727 |
728 void ProfileIdle(); | 728 void ProfileIdle(); |
729 | 729 |
| 730 // Visit all object pointers. Caller must ensure concurrent sweeper is not |
| 731 // running, and the visitor must not allocate. |
| 732 void VisitObjectPointers(ObjectPointerVisitor* visitor, |
| 733 bool visit_prologue_weak_persistent_handles, |
| 734 bool validate_frames); |
| 735 |
730 void set_user_tag(uword tag) { | 736 void set_user_tag(uword tag) { |
731 user_tag_ = tag; | 737 user_tag_ = tag; |
732 } | 738 } |
733 | 739 |
734 void set_mutator_thread(Thread* thread) { | 740 void set_mutator_thread(Thread* thread) { |
735 mutator_thread_ = thread; | 741 mutator_thread_ = thread; |
736 } | 742 } |
737 | 743 |
738 template<class T> T* AllocateReusableHandle(); | 744 template<class T> T* AllocateReusableHandle(); |
739 | 745 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 static void CheckForDuplicateThreadState(InterruptableThreadState* state); | 881 static void CheckForDuplicateThreadState(InterruptableThreadState* state); |
876 | 882 |
877 static Monitor* isolates_list_monitor_; // Protects isolates_list_head_ | 883 static Monitor* isolates_list_monitor_; // Protects isolates_list_head_ |
878 static Isolate* isolates_list_head_; | 884 static Isolate* isolates_list_head_; |
879 | 885 |
880 #define REUSABLE_FRIEND_DECLARATION(name) \ | 886 #define REUSABLE_FRIEND_DECLARATION(name) \ |
881 friend class Reusable##name##HandleScope; | 887 friend class Reusable##name##HandleScope; |
882 REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION) | 888 REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION) |
883 #undef REUSABLE_FRIEND_DECLARATION | 889 #undef REUSABLE_FRIEND_DECLARATION |
884 | 890 |
| 891 friend class GCMarker; // VisitObjectPointers |
| 892 friend class Scavenger; // VisitObjectPointers |
885 friend class ServiceIsolate; | 893 friend class ServiceIsolate; |
886 friend class Thread; | 894 friend class Thread; |
887 | 895 |
888 DISALLOW_COPY_AND_ASSIGN(Isolate); | 896 DISALLOW_COPY_AND_ASSIGN(Isolate); |
889 }; | 897 }; |
890 | 898 |
891 | 899 |
892 // When we need to execute code in an isolate, we use the | 900 // When we need to execute code in an isolate, we use the |
893 // StartIsolateScope. | 901 // StartIsolateScope. |
894 class StartIsolateScope { | 902 class StartIsolateScope { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 intptr_t serialized_args_len_; | 1024 intptr_t serialized_args_len_; |
1017 uint8_t* serialized_message_; | 1025 uint8_t* serialized_message_; |
1018 intptr_t serialized_message_len_; | 1026 intptr_t serialized_message_len_; |
1019 Isolate::Flags isolate_flags_; | 1027 Isolate::Flags isolate_flags_; |
1020 bool paused_; | 1028 bool paused_; |
1021 }; | 1029 }; |
1022 | 1030 |
1023 } // namespace dart | 1031 } // namespace dart |
1024 | 1032 |
1025 #endif // VM_ISOLATE_H_ | 1033 #endif // VM_ISOLATE_H_ |
OLD | NEW |