| 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 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/json.h" | 10 #include "platform/json.h" |
| (...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2344 | 2344 |
| 2345 static const char* NewConstChar(const char* chars) { | 2345 static const char* NewConstChar(const char* chars) { |
| 2346 size_t len = strlen(chars); | 2346 size_t len = strlen(chars); |
| 2347 char* mem = new char[len + 1]; | 2347 char* mem = new char[len + 1]; |
| 2348 memmove(mem, chars, len + 1); | 2348 memmove(mem, chars, len + 1); |
| 2349 return mem; | 2349 return mem; |
| 2350 } | 2350 } |
| 2351 | 2351 |
| 2352 | 2352 |
| 2353 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, | 2353 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, |
| 2354 Dart_Port origin_id, |
| 2355 void* init_data, |
| 2354 const Function& func, | 2356 const Function& func, |
| 2355 const Instance& message, | 2357 const Instance& message, |
| 2356 bool paused, | 2358 bool paused, |
| 2357 bool errors_are_fatal, | 2359 bool errors_are_fatal, |
| 2358 Dart_Port on_exit_port, | 2360 Dart_Port on_exit_port, |
| 2359 Dart_Port on_error_port) | 2361 Dart_Port on_error_port) |
| 2360 : isolate_(NULL), | 2362 : isolate_(NULL), |
| 2361 parent_port_(parent_port), | 2363 parent_port_(parent_port), |
| 2364 origin_id_(origin_id), |
| 2365 init_data_(init_data), |
| 2362 on_exit_port_(on_exit_port), | 2366 on_exit_port_(on_exit_port), |
| 2363 on_error_port_(on_error_port), | 2367 on_error_port_(on_error_port), |
| 2364 script_url_(NULL), | 2368 script_url_(NULL), |
| 2365 package_root_(NULL), | 2369 package_root_(NULL), |
| 2366 package_map_(NULL), | 2370 package_map_(NULL), |
| 2367 library_url_(NULL), | 2371 library_url_(NULL), |
| 2368 class_name_(NULL), | 2372 class_name_(NULL), |
| 2369 function_name_(NULL), | 2373 function_name_(NULL), |
| 2370 serialized_args_(NULL), | 2374 serialized_args_(NULL), |
| 2371 serialized_args_len_(0), | 2375 serialized_args_len_(0), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2389 SerializeObject(message, | 2393 SerializeObject(message, |
| 2390 &serialized_message_, | 2394 &serialized_message_, |
| 2391 &serialized_message_len_, | 2395 &serialized_message_len_, |
| 2392 can_send_any_object); | 2396 can_send_any_object); |
| 2393 // Inherit flags from spawning isolate. | 2397 // Inherit flags from spawning isolate. |
| 2394 isolate_flags()->CopyFrom(Isolate::Current()->flags()); | 2398 isolate_flags()->CopyFrom(Isolate::Current()->flags()); |
| 2395 } | 2399 } |
| 2396 | 2400 |
| 2397 | 2401 |
| 2398 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, | 2402 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, |
| 2403 void* init_data, |
| 2399 const char* script_url, | 2404 const char* script_url, |
| 2400 const char* package_root, | 2405 const char* package_root, |
| 2401 const char** package_map, | 2406 const char** package_map, |
| 2402 const Instance& args, | 2407 const Instance& args, |
| 2403 const Instance& message, | 2408 const Instance& message, |
| 2404 bool paused, | 2409 bool paused, |
| 2405 bool errors_are_fatal, | 2410 bool errors_are_fatal, |
| 2406 Dart_Port on_exit_port, | 2411 Dart_Port on_exit_port, |
| 2407 Dart_Port on_error_port) | 2412 Dart_Port on_error_port) |
| 2408 : isolate_(NULL), | 2413 : isolate_(NULL), |
| 2409 parent_port_(parent_port), | 2414 parent_port_(parent_port), |
| 2415 origin_id_(ILLEGAL_PORT), |
| 2416 init_data_(init_data), |
| 2410 on_exit_port_(on_exit_port), | 2417 on_exit_port_(on_exit_port), |
| 2411 on_error_port_(on_error_port), | 2418 on_error_port_(on_error_port), |
| 2412 script_url_(script_url), | 2419 script_url_(script_url), |
| 2413 package_root_(package_root), | 2420 package_root_(package_root), |
| 2414 package_map_(package_map), | 2421 package_map_(package_map), |
| 2415 library_url_(NULL), | 2422 library_url_(NULL), |
| 2416 class_name_(NULL), | 2423 class_name_(NULL), |
| 2417 function_name_(NULL), | 2424 function_name_(NULL), |
| 2418 serialized_args_(NULL), | 2425 serialized_args_(NULL), |
| 2419 serialized_args_len_(0), | 2426 serialized_args_len_(0), |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2530 } | 2537 } |
| 2531 | 2538 |
| 2532 | 2539 |
| 2533 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) { | 2540 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) { |
| 2534 return DeserializeObject(thread, | 2541 return DeserializeObject(thread, |
| 2535 serialized_message_, serialized_message_len_); | 2542 serialized_message_, serialized_message_len_); |
| 2536 } | 2543 } |
| 2537 | 2544 |
| 2538 | 2545 |
| 2539 } // namespace dart | 2546 } // namespace dart |
| OLD | NEW |