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 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 if (Flags::Lookup(flag_name) != NULL) { | 490 if (Flags::Lookup(flag_name) != NULL) { |
491 return true; | 491 return true; |
492 } | 492 } |
493 return false; | 493 return false; |
494 } | 494 } |
495 | 495 |
496 | 496 |
497 // --- Isolates --- | 497 // --- Isolates --- |
498 | 498 |
499 | 499 |
500 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const uint8_t* snapshot, | 500 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* name_prefix, |
| 501 const uint8_t* snapshot, |
501 void* callback_data, | 502 void* callback_data, |
502 char** error) { | 503 char** error) { |
503 Isolate* isolate = Dart::CreateIsolate(); | 504 Isolate* isolate = Dart::CreateIsolate(name_prefix); |
504 assert(isolate != NULL); | 505 assert(isolate != NULL); |
505 LongJump* base = isolate->long_jump_base(); | 506 LongJump* base = isolate->long_jump_base(); |
506 LongJump jump; | 507 LongJump jump; |
507 isolate->set_long_jump_base(&jump); | 508 isolate->set_long_jump_base(&jump); |
508 if (setjmp(*jump.Set()) == 0) { | 509 if (setjmp(*jump.Set()) == 0) { |
509 Dart::InitializeIsolate(snapshot, callback_data); | 510 Dart::InitializeIsolate(snapshot, callback_data); |
510 START_TIMER(time_total_runtime); | 511 START_TIMER(time_total_runtime); |
511 isolate->set_long_jump_base(base); | 512 isolate->set_long_jump_base(base); |
512 return reinterpret_cast<Dart_Isolate>(isolate); | 513 return reinterpret_cast<Dart_Isolate>(isolate); |
513 } else { | 514 } else { |
(...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 } | 2465 } |
2465 delete debug_region; | 2466 delete debug_region; |
2466 } else { | 2467 } else { |
2467 *buffer = NULL; | 2468 *buffer = NULL; |
2468 *buffer_size = 0; | 2469 *buffer_size = 0; |
2469 } | 2470 } |
2470 } | 2471 } |
2471 | 2472 |
2472 | 2473 |
2473 } // namespace dart | 2474 } // namespace dart |
OLD | NEW |