Chromium Code Reviews| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 kKillMsg = 4, | 122 kKillMsg = 4, |
| 123 kAddExitMsg = 5, | 123 kAddExitMsg = 5, |
| 124 kDelExitMsg = 6, | 124 kDelExitMsg = 6, |
| 125 kAddErrorMsg = 7, | 125 kAddErrorMsg = 7, |
| 126 kDelErrorMsg = 8, | 126 kDelErrorMsg = 8, |
| 127 kErrorFatalMsg = 9, | 127 kErrorFatalMsg = 9, |
| 128 | 128 |
| 129 // Internal message ids. | 129 // Internal message ids. |
| 130 kInterruptMsg = 10, // Break in the debugger. | 130 kInterruptMsg = 10, // Break in the debugger. |
| 131 kInternalKillMsg = 11, // Like kill, but does not run exit listeners, etc. | 131 kInternalKillMsg = 11, // Like kill, but does not run exit listeners, etc. |
| 132 kVMRestartMsg = 12, // Sent to isolates when vm is restarting. | |
| 132 }; | 133 }; |
| 133 // The different Isolate API message priorities for ping and kill messages. | 134 // The different Isolate API message priorities for ping and kill messages. |
| 134 enum LibMsgPriority { | 135 enum LibMsgPriority { |
| 135 kImmediateAction = 0, | 136 kImmediateAction = 0, |
| 136 kBeforeNextEventAction = 1, | 137 kBeforeNextEventAction = 1, |
| 137 kAsEventAction = 2 | 138 kAsEventAction = 2 |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 ~Isolate(); | 141 ~Isolate(); |
| 141 | 142 |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 759 ASSERT(Thread::Current() == mutator_thread_); | 760 ASSERT(Thread::Current() == mutator_thread_); |
| 760 return mutator_thread_->zone(); | 761 return mutator_thread_->zone(); |
| 761 } | 762 } |
| 762 void set_current_zone(Zone* zone) { | 763 void set_current_zone(Zone* zone) { |
| 763 ASSERT(Thread::Current() == mutator_thread_); | 764 ASSERT(Thread::Current() == mutator_thread_); |
| 764 mutator_thread_->set_zone(zone); | 765 mutator_thread_->set_zone(zone); |
| 765 } | 766 } |
| 766 | 767 |
| 767 bool is_service_isolate() const { return is_service_isolate_; } | 768 bool is_service_isolate() const { return is_service_isolate_; } |
| 768 | 769 |
| 770 // The isolates_list_monitor_ should be held when calling Kill(). | |
| 771 void KillLocked(LibMsgId msg_id = kInternalKillMsg); | |
|
zra
2015/10/05 16:56:47
Maybe instead of making this public, make RestartV
Cutch
2015/10/05 18:10:46
+1 to suggestion of dropping default msg_id value.
turnidge
2015/10/05 22:18:24
I have made this private again. I have added a ms
| |
| 772 | |
| 769 static void KillAllIsolates(); | 773 static void KillAllIsolates(); |
| 770 static void KillIfExists(Isolate* isolate); | 774 static void KillIfExists(Isolate* isolate); |
| 771 | 775 |
| 772 static void DisableIsolateCreation(); | 776 static void DisableIsolateCreation(); |
| 773 static void EnableIsolateCreation(); | 777 static void EnableIsolateCreation(); |
| 774 | 778 |
| 775 private: | 779 private: |
| 776 friend class Dart; // Init, InitOnce, Shutdown. | 780 friend class Dart; // Init, InitOnce, Shutdown. |
| 777 friend class IsolateKillerVisitor; // Kill(). | 781 friend class IsolateKillerVisitor; // Kill(). |
| 778 | 782 |
| 779 explicit Isolate(const Dart_IsolateFlags& api_flags); | 783 explicit Isolate(const Dart_IsolateFlags& api_flags); |
| 780 | 784 |
| 781 static void InitOnce(); | 785 static void InitOnce(); |
| 782 static Isolate* Init(const char* name_prefix, | 786 static Isolate* Init(const char* name_prefix, |
| 783 const Dart_IsolateFlags& api_flags, | 787 const Dart_IsolateFlags& api_flags, |
| 784 bool is_vm_isolate = false); | 788 bool is_vm_isolate = false); |
| 785 | 789 |
| 786 // The isolates_list_monitor_ should be held when calling Kill(). | |
| 787 void KillLocked(); | |
| 788 | |
| 789 void LowLevelShutdown(); | 790 void LowLevelShutdown(); |
| 790 void Shutdown(); | 791 void Shutdown(); |
| 791 void ReclaimTimelineBlocks(); | 792 void ReclaimTimelineBlocks(); |
| 792 | 793 |
| 793 void BuildName(const char* name_prefix); | 794 void BuildName(const char* name_prefix); |
| 794 void PrintInvokedFunctions(); | 795 void PrintInvokedFunctions(); |
| 795 | 796 |
| 796 void ProfileIdle(); | 797 void ProfileIdle(); |
| 797 | 798 |
| 798 // Visit all object pointers. Caller must ensure concurrent sweeper is not | 799 // Visit all object pointers. Caller must ensure concurrent sweeper is not |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1137 uint8_t* serialized_message_; | 1138 uint8_t* serialized_message_; |
| 1138 intptr_t serialized_message_len_; | 1139 intptr_t serialized_message_len_; |
| 1139 Isolate::Flags isolate_flags_; | 1140 Isolate::Flags isolate_flags_; |
| 1140 bool paused_; | 1141 bool paused_; |
| 1141 bool errors_are_fatal_; | 1142 bool errors_are_fatal_; |
| 1142 }; | 1143 }; |
| 1143 | 1144 |
| 1144 } // namespace dart | 1145 } // namespace dart |
| 1145 | 1146 |
| 1146 #endif // VM_ISOLATE_H_ | 1147 #endif // VM_ISOLATE_H_ |
| OLD | NEW |