OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 <limits.h> | 8 #include <limits.h> |
9 | 9 |
10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return 0; | 179 return 0; |
180 #endif | 180 #endif |
181 } | 181 } |
182 | 182 |
183 void set_top_handle_scope(HandleScope* handle_scope) { | 183 void set_top_handle_scope(HandleScope* handle_scope) { |
184 #if defined(DEBUG) | 184 #if defined(DEBUG) |
185 top_handle_scope_ = handle_scope; | 185 top_handle_scope_ = handle_scope; |
186 #endif | 186 #endif |
187 } | 187 } |
188 | 188 |
189 void set_init_callback_data(void* value) { | |
190 init_callback_data_ = value; | |
191 } | |
192 void* init_callback_data() const { | |
193 return init_callback_data_; | |
194 } | |
195 | |
196 Dart_LibraryTagHandler library_tag_handler() const { | 189 Dart_LibraryTagHandler library_tag_handler() const { |
197 return library_tag_handler_; | 190 return library_tag_handler_; |
198 } | 191 } |
199 void set_library_tag_handler(Dart_LibraryTagHandler value) { | 192 void set_library_tag_handler(Dart_LibraryTagHandler value) { |
200 library_tag_handler_ = value; | 193 library_tag_handler_ = value; |
201 } | 194 } |
202 | 195 |
203 static void SetInitCallback(Dart_IsolateInitCallback callback); | 196 static void SetCreateAndInitCallback(Dart_IsolateCreateAndInitCallback cback); |
204 static Dart_IsolateInitCallback InitCallback(); | 197 static Dart_IsolateCreateAndInitCallback CreateAndInitCallback(); |
205 | 198 |
206 uword stack_limit_address() const { | 199 uword stack_limit_address() const { |
207 return reinterpret_cast<uword>(&stack_limit_); | 200 return reinterpret_cast<uword>(&stack_limit_); |
208 } | 201 } |
209 | 202 |
210 void SetStackLimit(uword value); | 203 void SetStackLimit(uword value); |
211 uword stack_limit() const { return stack_limit_; } | 204 uword stack_limit() const { return stack_limit_; } |
212 | 205 |
213 void SetStackLimitFromCurrentTOS(uword isolate_stack_top); | 206 void SetStackLimitFromCurrentTOS(uword isolate_stack_top); |
214 | 207 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 RawContext* top_context_; | 240 RawContext* top_context_; |
248 Zone* current_zone_; | 241 Zone* current_zone_; |
249 #if defined(DEBUG) | 242 #if defined(DEBUG) |
250 int32_t no_gc_scope_depth_; | 243 int32_t no_gc_scope_depth_; |
251 int32_t no_handle_scope_depth_; | 244 int32_t no_handle_scope_depth_; |
252 HandleScope* top_handle_scope_; | 245 HandleScope* top_handle_scope_; |
253 #endif | 246 #endif |
254 int32_t random_seed_; | 247 int32_t random_seed_; |
255 BigintStore* bigint_store_; | 248 BigintStore* bigint_store_; |
256 uword top_exit_frame_info_; | 249 uword top_exit_frame_info_; |
257 void* init_callback_data_; | |
258 Dart_LibraryTagHandler library_tag_handler_; | 250 Dart_LibraryTagHandler library_tag_handler_; |
259 ApiState* api_state_; | 251 ApiState* api_state_; |
260 StubCode* stub_code_; | 252 StubCode* stub_code_; |
261 CodeIndexTable* code_index_table_; | 253 CodeIndexTable* code_index_table_; |
262 LongJump* long_jump_base_; | 254 LongJump* long_jump_base_; |
263 TimerList timer_list_; | 255 TimerList timer_list_; |
264 uword stack_limit_; | 256 uword stack_limit_; |
265 uword stack_limit_on_overflow_exception_; | 257 uword stack_limit_on_overflow_exception_; |
266 intptr_t ast_node_id_; | 258 intptr_t ast_node_id_; |
267 | 259 |
268 static Dart_IsolateInitCallback init_callback_; | 260 static Dart_IsolateCreateAndInitCallback create_init_callback_; |
269 | 261 |
270 DISALLOW_COPY_AND_ASSIGN(Isolate); | 262 DISALLOW_COPY_AND_ASSIGN(Isolate); |
271 }; | 263 }; |
272 | 264 |
273 } // namespace dart | 265 } // namespace dart |
274 | 266 |
275 #if defined(TARGET_OS_LINUX) | 267 #if defined(TARGET_OS_LINUX) |
276 #include "vm/isolate_linux.h" | 268 #include "vm/isolate_linux.h" |
277 #elif defined(TARGET_OS_MACOS) | 269 #elif defined(TARGET_OS_MACOS) |
278 #include "vm/isolate_macos.h" | 270 #include "vm/isolate_macos.h" |
279 #elif defined(TARGET_OS_WINDOWS) | 271 #elif defined(TARGET_OS_WINDOWS) |
280 #include "vm/isolate_win.h" | 272 #include "vm/isolate_win.h" |
281 #else | 273 #else |
282 #error Unknown target os. | 274 #error Unknown target os. |
283 #endif | 275 #endif |
284 | 276 |
285 #endif // VM_ISOLATE_H_ | 277 #endif // VM_ISOLATE_H_ |
OLD | NEW |