Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: runtime/vm/isolate.cc

Issue 1447353002: Start isolates in a separate thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: reupload Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/isolate_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 2400
2401 static const char* NewConstChar(const char* chars) { 2401 static const char* NewConstChar(const char* chars) {
2402 size_t len = strlen(chars); 2402 size_t len = strlen(chars);
2403 char* mem = new char[len + 1]; 2403 char* mem = new char[len + 1];
2404 memmove(mem, chars, len + 1); 2404 memmove(mem, chars, len + 1);
2405 return mem; 2405 return mem;
2406 } 2406 }
2407 2407
2408 2408
2409 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, 2409 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
2410 Dart_Port origin_id,
2411 void* init_data,
2410 const Function& func, 2412 const Function& func,
2411 const Instance& message, 2413 const Instance& message,
2412 bool paused, 2414 bool paused,
2413 bool errors_are_fatal, 2415 bool errors_are_fatal,
2414 Dart_Port on_exit_port, 2416 Dart_Port on_exit_port,
2415 Dart_Port on_error_port) 2417 Dart_Port on_error_port)
2416 : isolate_(NULL), 2418 : isolate_(NULL),
2417 parent_port_(parent_port), 2419 parent_port_(parent_port),
2420 origin_id_(origin_id),
2421 init_data_(init_data),
2418 on_exit_port_(on_exit_port), 2422 on_exit_port_(on_exit_port),
2419 on_error_port_(on_error_port), 2423 on_error_port_(on_error_port),
2420 script_url_(NULL), 2424 script_url_(NULL),
2421 package_root_(NULL), 2425 package_root_(NULL),
2422 package_map_(NULL), 2426 package_map_(NULL),
2423 library_url_(NULL), 2427 library_url_(NULL),
2424 class_name_(NULL), 2428 class_name_(NULL),
2425 function_name_(NULL), 2429 function_name_(NULL),
2426 serialized_args_(NULL), 2430 serialized_args_(NULL),
2427 serialized_args_len_(0), 2431 serialized_args_len_(0),
(...skipping 17 matching lines...) Expand all
2445 SerializeObject(message, 2449 SerializeObject(message,
2446 &serialized_message_, 2450 &serialized_message_,
2447 &serialized_message_len_, 2451 &serialized_message_len_,
2448 can_send_any_object); 2452 can_send_any_object);
2449 // Inherit flags from spawning isolate. 2453 // Inherit flags from spawning isolate.
2450 isolate_flags()->CopyFrom(Isolate::Current()->flags()); 2454 isolate_flags()->CopyFrom(Isolate::Current()->flags());
2451 } 2455 }
2452 2456
2453 2457
2454 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port, 2458 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
2459 void* init_data,
2455 const char* script_url, 2460 const char* script_url,
2456 const char* package_root, 2461 const char* package_root,
2457 const char** package_map, 2462 const char** package_map,
2458 const Instance& args, 2463 const Instance& args,
2459 const Instance& message, 2464 const Instance& message,
2460 bool paused, 2465 bool paused,
2461 bool errors_are_fatal, 2466 bool errors_are_fatal,
2462 Dart_Port on_exit_port, 2467 Dart_Port on_exit_port,
2463 Dart_Port on_error_port) 2468 Dart_Port on_error_port)
2464 : isolate_(NULL), 2469 : isolate_(NULL),
2465 parent_port_(parent_port), 2470 parent_port_(parent_port),
2471 origin_id_(ILLEGAL_PORT),
2472 init_data_(init_data),
2466 on_exit_port_(on_exit_port), 2473 on_exit_port_(on_exit_port),
2467 on_error_port_(on_error_port), 2474 on_error_port_(on_error_port),
2468 script_url_(script_url), 2475 script_url_(script_url),
2469 package_root_(package_root), 2476 package_root_(package_root),
2470 package_map_(package_map), 2477 package_map_(package_map),
2471 library_url_(NULL), 2478 library_url_(NULL),
2472 class_name_(NULL), 2479 class_name_(NULL),
2473 function_name_(NULL), 2480 function_name_(NULL),
2474 serialized_args_(NULL), 2481 serialized_args_(NULL),
2475 serialized_args_len_(0), 2482 serialized_args_len_(0),
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2586 } 2593 }
2587 2594
2588 2595
2589 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) { 2596 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) {
2590 return DeserializeObject(thread, 2597 return DeserializeObject(thread,
2591 serialized_message_, serialized_message_len_); 2598 serialized_message_, serialized_message_len_);
2592 } 2599 }
2593 2600
2594 2601
2595 } // namespace dart 2602 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/isolate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698