| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 797 |
| 798 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri, | 798 DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri, |
| 799 const char* main, | 799 const char* main, |
| 800 const uint8_t* snapshot, | 800 const uint8_t* snapshot, |
| 801 void* callback_data, | 801 void* callback_data, |
| 802 char** error) { | 802 char** error) { |
| 803 char* isolate_name = BuildIsolateName(script_uri, main); | 803 char* isolate_name = BuildIsolateName(script_uri, main); |
| 804 Isolate* isolate = Dart::CreateIsolate(isolate_name); | 804 Isolate* isolate = Dart::CreateIsolate(isolate_name); |
| 805 free(isolate_name); | 805 free(isolate_name); |
| 806 { | 806 { |
| 807 StackZone zone(isolate); |
| 807 DARTSCOPE_NOCHECKS(isolate); | 808 DARTSCOPE_NOCHECKS(isolate); |
| 808 const Error& error_obj = | 809 const Error& error_obj = |
| 809 Error::Handle(isolate, | 810 Error::Handle(isolate, |
| 810 Dart::InitializeIsolate(snapshot, callback_data)); | 811 Dart::InitializeIsolate(snapshot, callback_data)); |
| 811 if (error_obj.IsNull()) { | 812 if (error_obj.IsNull()) { |
| 812 START_TIMER(time_total_runtime); | 813 START_TIMER(time_total_runtime); |
| 813 return reinterpret_cast<Dart_Isolate>(isolate); | 814 return reinterpret_cast<Dart_Isolate>(isolate); |
| 814 } | 815 } |
| 815 *error = strdup(error_obj.ToErrorCString()); | 816 *error = strdup(error_obj.ToErrorCString()); |
| 816 } | 817 } |
| (...skipping 3689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4506 } | 4507 } |
| 4507 { | 4508 { |
| 4508 NoGCScope no_gc; | 4509 NoGCScope no_gc; |
| 4509 RawObject* raw_obj = obj.raw(); | 4510 RawObject* raw_obj = obj.raw(); |
| 4510 isolate->heap()->SetPeer(raw_obj, peer); | 4511 isolate->heap()->SetPeer(raw_obj, peer); |
| 4511 } | 4512 } |
| 4512 return Api::Success(isolate); | 4513 return Api::Success(isolate); |
| 4513 } | 4514 } |
| 4514 | 4515 |
| 4515 } // namespace dart | 4516 } // namespace dart |
| OLD | NEW |