| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 const uint8_t* snapshot, | 1233 const uint8_t* snapshot, |
| 1234 Dart_IsolateFlags* flags, | 1234 Dart_IsolateFlags* flags, |
| 1235 void* callback_data, | 1235 void* callback_data, |
| 1236 char** error) { | 1236 char** error) { |
| 1237 CHECK_NO_ISOLATE(Isolate::Current()); | 1237 CHECK_NO_ISOLATE(Isolate::Current()); |
| 1238 char* isolate_name = BuildIsolateName(script_uri, main); | 1238 char* isolate_name = BuildIsolateName(script_uri, main); |
| 1239 | 1239 |
| 1240 // Setup default flags in case none were passed. | 1240 // Setup default flags in case none were passed. |
| 1241 Dart_IsolateFlags api_flags; | 1241 Dart_IsolateFlags api_flags; |
| 1242 if (flags == NULL) { | 1242 if (flags == NULL) { |
| 1243 Isolate::Flags vm_flags; | 1243 Isolate::FlagsInitialize(&api_flags); |
| 1244 vm_flags.CopyTo(&api_flags); | |
| 1245 flags = &api_flags; | 1244 flags = &api_flags; |
| 1246 } | 1245 } |
| 1247 Isolate* I = Dart::CreateIsolate(isolate_name, *flags); | 1246 Isolate* I = Dart::CreateIsolate(isolate_name, *flags); |
| 1248 free(isolate_name); | 1247 free(isolate_name); |
| 1249 if (I == NULL) { | 1248 if (I == NULL) { |
| 1250 *error = strdup("Isolate creation failed"); | 1249 *error = strdup("Isolate creation failed"); |
| 1251 return reinterpret_cast<Dart_Isolate>(NULL); | 1250 return reinterpret_cast<Dart_Isolate>(NULL); |
| 1252 } | 1251 } |
| 1253 { | 1252 { |
| 1254 Thread* T = Thread::Current(); | 1253 Thread* T = Thread::Current(); |
| (...skipping 4911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6166 return Api::Success(); | 6165 return Api::Success(); |
| 6167 } | 6166 } |
| 6168 #endif // DART_PRECOMPILER | 6167 #endif // DART_PRECOMPILER |
| 6169 | 6168 |
| 6170 | 6169 |
| 6171 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 6170 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
| 6172 return Dart::IsRunningPrecompiledCode(); | 6171 return Dart::IsRunningPrecompiledCode(); |
| 6173 } | 6172 } |
| 6174 | 6173 |
| 6175 } // namespace dart | 6174 } // namespace dart |
| OLD | NEW |