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