| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 | 908 |
| 909 DISALLOW_COPY_AND_ASSIGN(StartIsolateScope); | 909 DISALLOW_COPY_AND_ASSIGN(StartIsolateScope); |
| 910 }; | 910 }; |
| 911 | 911 |
| 912 | 912 |
| 913 class IsolateSpawnState { | 913 class IsolateSpawnState { |
| 914 public: | 914 public: |
| 915 IsolateSpawnState(Dart_Port parent_port, | 915 IsolateSpawnState(Dart_Port parent_port, |
| 916 Dart_Port origin_id, | 916 Dart_Port origin_id, |
| 917 void* init_data, | 917 void* init_data, |
| 918 const char* script_url, |
| 918 const Function& func, | 919 const Function& func, |
| 919 const Instance& message, | 920 const Instance& message, |
| 920 Monitor* spawn_count_monitor, | 921 Monitor* spawn_count_monitor, |
| 921 intptr_t* spawn_count, | 922 intptr_t* spawn_count, |
| 923 const char* package_root, |
| 924 const char* package_config, |
| 922 bool paused, | 925 bool paused, |
| 923 bool errorsAreFatal, | 926 bool errorsAreFatal, |
| 924 Dart_Port onExit, | 927 Dart_Port onExit, |
| 925 Dart_Port onError); | 928 Dart_Port onError); |
| 926 IsolateSpawnState(Dart_Port parent_port, | 929 IsolateSpawnState(Dart_Port parent_port, |
| 927 void* init_data, | 930 void* init_data, |
| 928 const char* script_url, | 931 const char* script_url, |
| 929 const char* package_root, | 932 const char* package_root, |
| 930 const char** package_map, | 933 const char* package_config, |
| 931 const Instance& args, | 934 const Instance& args, |
| 932 const Instance& message, | 935 const Instance& message, |
| 933 Monitor* spawn_count_monitor, | 936 Monitor* spawn_count_monitor, |
| 934 intptr_t* spawn_count, | 937 intptr_t* spawn_count, |
| 935 bool paused, | 938 bool paused, |
| 936 bool errorsAreFatal, | 939 bool errorsAreFatal, |
| 937 Dart_Port onExit, | 940 Dart_Port onExit, |
| 938 Dart_Port onError); | 941 Dart_Port onError); |
| 939 ~IsolateSpawnState(); | 942 ~IsolateSpawnState(); |
| 940 | 943 |
| 941 Isolate* isolate() const { return isolate_; } | 944 Isolate* isolate() const { return isolate_; } |
| 942 void set_isolate(Isolate* value) { isolate_ = value; } | 945 void set_isolate(Isolate* value) { isolate_ = value; } |
| 943 | 946 |
| 944 Dart_Port parent_port() const { return parent_port_; } | 947 Dart_Port parent_port() const { return parent_port_; } |
| 945 Dart_Port origin_id() const { return origin_id_; } | 948 Dart_Port origin_id() const { return origin_id_; } |
| 946 void* init_data() const { return init_data_; } | 949 void* init_data() const { return init_data_; } |
| 947 Dart_Port on_exit_port() const { return on_exit_port_; } | 950 Dart_Port on_exit_port() const { return on_exit_port_; } |
| 948 Dart_Port on_error_port() const { return on_error_port_; } | 951 Dart_Port on_error_port() const { return on_error_port_; } |
| 949 const char* script_url() const { return script_url_; } | 952 const char* script_url() const { return script_url_; } |
| 950 const char* package_root() const { return package_root_; } | 953 const char* package_root() const { return package_root_; } |
| 951 const char** package_map() const { return package_map_; } | 954 const char* package_config() const { return package_config_; } |
| 952 const char* library_url() const { return library_url_; } | 955 const char* library_url() const { return library_url_; } |
| 953 const char* class_name() const { return class_name_; } | 956 const char* class_name() const { return class_name_; } |
| 954 const char* function_name() const { return function_name_; } | 957 const char* function_name() const { return function_name_; } |
| 955 bool is_spawn_uri() const { return library_url_ == NULL; } | 958 bool is_spawn_uri() const { return library_url_ == NULL; } |
| 956 bool paused() const { return paused_; } | 959 bool paused() const { return paused_; } |
| 957 bool errors_are_fatal() const { return errors_are_fatal_; } | 960 bool errors_are_fatal() const { return errors_are_fatal_; } |
| 958 Isolate::Flags* isolate_flags() { return &isolate_flags_; } | 961 Isolate::Flags* isolate_flags() { return &isolate_flags_; } |
| 959 | 962 |
| 960 RawObject* ResolveFunction(); | 963 RawObject* ResolveFunction(); |
| 961 RawInstance* BuildArgs(Thread* thread); | 964 RawInstance* BuildArgs(Thread* thread); |
| 962 RawInstance* BuildMessage(Thread* thread); | 965 RawInstance* BuildMessage(Thread* thread); |
| 963 | 966 |
| 964 void DecrementSpawnCount(); | 967 void DecrementSpawnCount(); |
| 965 | 968 |
| 966 private: | 969 private: |
| 967 Isolate* isolate_; | 970 Isolate* isolate_; |
| 968 Dart_Port parent_port_; | 971 Dart_Port parent_port_; |
| 969 Dart_Port origin_id_; | 972 Dart_Port origin_id_; |
| 970 void* init_data_; | 973 void* init_data_; |
| 971 Dart_Port on_exit_port_; | 974 Dart_Port on_exit_port_; |
| 972 Dart_Port on_error_port_; | 975 Dart_Port on_error_port_; |
| 973 const char* script_url_; | 976 const char* script_url_; |
| 974 const char* package_root_; | 977 const char* package_root_; |
| 975 const char** package_map_; | 978 const char* package_config_; |
| 976 const char* library_url_; | 979 const char* library_url_; |
| 977 const char* class_name_; | 980 const char* class_name_; |
| 978 const char* function_name_; | 981 const char* function_name_; |
| 979 uint8_t* serialized_args_; | 982 uint8_t* serialized_args_; |
| 980 intptr_t serialized_args_len_; | 983 intptr_t serialized_args_len_; |
| 981 uint8_t* serialized_message_; | 984 uint8_t* serialized_message_; |
| 982 intptr_t serialized_message_len_; | 985 intptr_t serialized_message_len_; |
| 983 | 986 |
| 984 // This counter tracks the number of outstanding calls to spawn by the parent | 987 // This counter tracks the number of outstanding calls to spawn by the parent |
| 985 // isolate. | 988 // isolate. |
| 986 Monitor* spawn_count_monitor_; | 989 Monitor* spawn_count_monitor_; |
| 987 intptr_t* spawn_count_; | 990 intptr_t* spawn_count_; |
| 988 | 991 |
| 989 Isolate::Flags isolate_flags_; | 992 Isolate::Flags isolate_flags_; |
| 990 bool paused_; | 993 bool paused_; |
| 991 bool errors_are_fatal_; | 994 bool errors_are_fatal_; |
| 992 }; | 995 }; |
| 993 | 996 |
| 994 } // namespace dart | 997 } // namespace dart |
| 995 | 998 |
| 996 #endif // VM_ISOLATE_H_ | 999 #endif // VM_ISOLATE_H_ |
| OLD | NEW |