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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 Isolate* new_isolate_; | 931 Isolate* new_isolate_; |
932 Isolate* saved_isolate_; | 932 Isolate* saved_isolate_; |
933 | 933 |
934 DISALLOW_COPY_AND_ASSIGN(StartIsolateScope); | 934 DISALLOW_COPY_AND_ASSIGN(StartIsolateScope); |
935 }; | 935 }; |
936 | 936 |
937 | 937 |
938 class IsolateSpawnState { | 938 class IsolateSpawnState { |
939 public: | 939 public: |
940 IsolateSpawnState(Dart_Port parent_port, | 940 IsolateSpawnState(Dart_Port parent_port, |
| 941 Dart_Port origin_id, |
| 942 void* init_data, |
941 const Function& func, | 943 const Function& func, |
942 const Instance& message, | 944 const Instance& message, |
943 bool paused, | 945 bool paused, |
944 bool errorsAreFatal, | 946 bool errorsAreFatal, |
945 Dart_Port onExit, | 947 Dart_Port onExit, |
946 Dart_Port onError); | 948 Dart_Port onError); |
947 IsolateSpawnState(Dart_Port parent_port, | 949 IsolateSpawnState(Dart_Port parent_port, |
| 950 void* init_data, |
948 const char* script_url, | 951 const char* script_url, |
949 const char* package_root, | 952 const char* package_root, |
950 const char** package_map, | 953 const char** package_map, |
951 const Instance& args, | 954 const Instance& args, |
952 const Instance& message, | 955 const Instance& message, |
953 bool paused, | 956 bool paused, |
954 bool errorsAreFatal, | 957 bool errorsAreFatal, |
955 Dart_Port onExit, | 958 Dart_Port onExit, |
956 Dart_Port onError); | 959 Dart_Port onError); |
957 ~IsolateSpawnState(); | 960 ~IsolateSpawnState(); |
958 | 961 |
959 Isolate* isolate() const { return isolate_; } | 962 Isolate* isolate() const { return isolate_; } |
960 void set_isolate(Isolate* value) { isolate_ = value; } | 963 void set_isolate(Isolate* value) { isolate_ = value; } |
961 | 964 |
962 Dart_Port parent_port() const { return parent_port_; } | 965 Dart_Port parent_port() const { return parent_port_; } |
| 966 Dart_Port origin_id() const { return origin_id_; } |
| 967 void* init_data() const { return init_data_; } |
963 Dart_Port on_exit_port() const { return on_exit_port_; } | 968 Dart_Port on_exit_port() const { return on_exit_port_; } |
964 Dart_Port on_error_port() const { return on_error_port_; } | 969 Dart_Port on_error_port() const { return on_error_port_; } |
965 const char* script_url() const { return script_url_; } | 970 const char* script_url() const { return script_url_; } |
966 const char* package_root() const { return package_root_; } | 971 const char* package_root() const { return package_root_; } |
967 const char** package_map() const { return package_map_; } | 972 const char** package_map() const { return package_map_; } |
968 const char* library_url() const { return library_url_; } | 973 const char* library_url() const { return library_url_; } |
969 const char* class_name() const { return class_name_; } | 974 const char* class_name() const { return class_name_; } |
970 const char* function_name() const { return function_name_; } | 975 const char* function_name() const { return function_name_; } |
971 bool is_spawn_uri() const { return library_url_ == NULL; } | 976 bool is_spawn_uri() const { return library_url_ == NULL; } |
972 bool paused() const { return paused_; } | 977 bool paused() const { return paused_; } |
973 bool errors_are_fatal() const { return errors_are_fatal_; } | 978 bool errors_are_fatal() const { return errors_are_fatal_; } |
974 Isolate::Flags* isolate_flags() { return &isolate_flags_; } | 979 Isolate::Flags* isolate_flags() { return &isolate_flags_; } |
975 | 980 |
976 RawObject* ResolveFunction(); | 981 RawObject* ResolveFunction(); |
977 RawInstance* BuildArgs(Thread* thread); | 982 RawInstance* BuildArgs(Thread* thread); |
978 RawInstance* BuildMessage(Thread* thread); | 983 RawInstance* BuildMessage(Thread* thread); |
979 | 984 |
980 private: | 985 private: |
981 Isolate* isolate_; | 986 Isolate* isolate_; |
982 Dart_Port parent_port_; | 987 Dart_Port parent_port_; |
| 988 Dart_Port origin_id_; |
| 989 void* init_data_; |
983 Dart_Port on_exit_port_; | 990 Dart_Port on_exit_port_; |
984 Dart_Port on_error_port_; | 991 Dart_Port on_error_port_; |
985 const char* script_url_; | 992 const char* script_url_; |
986 const char* package_root_; | 993 const char* package_root_; |
987 const char** package_map_; | 994 const char** package_map_; |
988 const char* library_url_; | 995 const char* library_url_; |
989 const char* class_name_; | 996 const char* class_name_; |
990 const char* function_name_; | 997 const char* function_name_; |
991 uint8_t* serialized_args_; | 998 uint8_t* serialized_args_; |
992 intptr_t serialized_args_len_; | 999 intptr_t serialized_args_len_; |
993 uint8_t* serialized_message_; | 1000 uint8_t* serialized_message_; |
994 intptr_t serialized_message_len_; | 1001 intptr_t serialized_message_len_; |
995 Isolate::Flags isolate_flags_; | 1002 Isolate::Flags isolate_flags_; |
996 bool paused_; | 1003 bool paused_; |
997 bool errors_are_fatal_; | 1004 bool errors_are_fatal_; |
998 }; | 1005 }; |
999 | 1006 |
1000 } // namespace dart | 1007 } // namespace dart |
1001 | 1008 |
1002 #endif // VM_ISOLATE_H_ | 1009 #endif // VM_ISOLATE_H_ |
OLD | NEW |