| 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 RUNTIME_VM_ISOLATE_H_ | 5 #ifndef RUNTIME_VM_ISOLATE_H_ |
| 6 #define RUNTIME_VM_ISOLATE_H_ | 6 #define RUNTIME_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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 ~NoReloadScope(); | 121 ~NoReloadScope(); |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 Isolate* isolate_; | 124 Isolate* isolate_; |
| 125 DISALLOW_COPY_AND_ASSIGN(NoReloadScope); | 125 DISALLOW_COPY_AND_ASSIGN(NoReloadScope); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 | 128 |
| 129 // Fixed cache for exception handler lookup. | 129 // Fixed cache for exception handler lookup. |
| 130 typedef FixedCache<intptr_t, ExceptionHandlerInfo, 16> HandlerInfoCache; | 130 typedef FixedCache<intptr_t, ExceptionHandlerInfo, 16> HandlerInfoCache; |
| 131 // Fixed cache for catch entry state lookup. | |
| 132 typedef FixedCache<intptr_t, CatchEntryState, 16> CatchEntryStateCache; | |
| 133 | 131 |
| 134 // List of Isolate flags with corresponding members of Dart_IsolateFlags and | 132 // List of Isolate flags with corresponding members of Dart_IsolateFlags and |
| 135 // corresponding global command line flags. | 133 // corresponding global command line flags. |
| 136 // | 134 // |
| 137 // V(name, Dart_IsolateFlags-member-name, command-line-flag-name) | 135 // V(name, Dart_IsolateFlags-member-name, command-line-flag-name) |
| 138 // | 136 // |
| 139 #define ISOLATE_FLAG_LIST(V) \ | 137 #define ISOLATE_FLAG_LIST(V) \ |
| 140 V(type_checks, enable_type_checks, FLAG_enable_type_checks) \ | 138 V(type_checks, enable_type_checks, FLAG_enable_type_checks) \ |
| 141 V(asserts, enable_asserts, FLAG_enable_asserts) \ | 139 V(asserts, enable_asserts, FLAG_enable_asserts) \ |
| 142 V(error_on_bad_type, enable_error_on_bad_type, FLAG_error_on_bad_type) \ | 140 V(error_on_bad_type, enable_error_on_bad_type, FLAG_error_on_bad_type) \ |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 static bool IsolateCreationEnabled(); | 668 static bool IsolateCreationEnabled(); |
| 671 | 669 |
| 672 void StopBackgroundCompiler(); | 670 void StopBackgroundCompiler(); |
| 673 | 671 |
| 674 intptr_t reload_every_n_stack_overflow_checks() const { | 672 intptr_t reload_every_n_stack_overflow_checks() const { |
| 675 return reload_every_n_stack_overflow_checks_; | 673 return reload_every_n_stack_overflow_checks_; |
| 676 } | 674 } |
| 677 | 675 |
| 678 HandlerInfoCache* handler_info_cache() { return &handler_info_cache_; } | 676 HandlerInfoCache* handler_info_cache() { return &handler_info_cache_; } |
| 679 | 677 |
| 680 CatchEntryStateCache* catch_entry_state_cache() { | |
| 681 return &catch_entry_state_cache_; | |
| 682 } | |
| 683 | |
| 684 void MaybeIncreaseReloadEveryNStackOverflowChecks(); | 678 void MaybeIncreaseReloadEveryNStackOverflowChecks(); |
| 685 | 679 |
| 686 private: | 680 private: |
| 687 friend class Dart; // Init, InitOnce, Shutdown. | 681 friend class Dart; // Init, InitOnce, Shutdown. |
| 688 friend class IsolateKillerVisitor; // Kill(). | 682 friend class IsolateKillerVisitor; // Kill(). |
| 689 | 683 |
| 690 explicit Isolate(const Dart_IsolateFlags& api_flags); | 684 explicit Isolate(const Dart_IsolateFlags& api_flags); |
| 691 | 685 |
| 692 static void InitOnce(); | 686 static void InitOnce(); |
| 693 static Isolate* Init(const char* name_prefix, | 687 static Isolate* Init(const char* name_prefix, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 bool has_attempted_reload_; | 863 bool has_attempted_reload_; |
| 870 intptr_t no_reload_scope_depth_; // we can only reload when this is 0. | 864 intptr_t no_reload_scope_depth_; // we can only reload when this is 0. |
| 871 // Per-isolate copy of FLAG_reload_every. | 865 // Per-isolate copy of FLAG_reload_every. |
| 872 intptr_t reload_every_n_stack_overflow_checks_; | 866 intptr_t reload_every_n_stack_overflow_checks_; |
| 873 IsolateReloadContext* reload_context_; | 867 IsolateReloadContext* reload_context_; |
| 874 int64_t last_reload_timestamp_; | 868 int64_t last_reload_timestamp_; |
| 875 // Should we pause in the debug message loop after this request? | 869 // Should we pause in the debug message loop after this request? |
| 876 bool should_pause_post_service_request_; | 870 bool should_pause_post_service_request_; |
| 877 | 871 |
| 878 HandlerInfoCache handler_info_cache_; | 872 HandlerInfoCache handler_info_cache_; |
| 879 CatchEntryStateCache catch_entry_state_cache_; | |
| 880 | 873 |
| 881 static Dart_IsolateCreateCallback create_callback_; | 874 static Dart_IsolateCreateCallback create_callback_; |
| 882 static Dart_IsolateShutdownCallback shutdown_callback_; | 875 static Dart_IsolateShutdownCallback shutdown_callback_; |
| 883 static Dart_IsolateCleanupCallback cleanup_callback_; | 876 static Dart_IsolateCleanupCallback cleanup_callback_; |
| 884 | 877 |
| 885 static void WakePauseEventHandler(Dart_Isolate isolate); | 878 static void WakePauseEventHandler(Dart_Isolate isolate); |
| 886 | 879 |
| 887 // Manage list of existing isolates. | 880 // Manage list of existing isolates. |
| 888 static bool AddIsolateToList(Isolate* isolate); | 881 static bool AddIsolateToList(Isolate* isolate); |
| 889 static void RemoveIsolateFromList(Isolate* isolate); | 882 static void RemoveIsolateFromList(Isolate* isolate); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 intptr_t* spawn_count_; | 1028 intptr_t* spawn_count_; |
| 1036 | 1029 |
| 1037 Dart_IsolateFlags isolate_flags_; | 1030 Dart_IsolateFlags isolate_flags_; |
| 1038 bool paused_; | 1031 bool paused_; |
| 1039 bool errors_are_fatal_; | 1032 bool errors_are_fatal_; |
| 1040 }; | 1033 }; |
| 1041 | 1034 |
| 1042 } // namespace dart | 1035 } // namespace dart |
| 1043 | 1036 |
| 1044 #endif // RUNTIME_VM_ISOLATE_H_ | 1037 #endif // RUNTIME_VM_ISOLATE_H_ |
| OLD | NEW |