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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 } | 1132 } |
1133 | 1133 |
1134 DART_EXPORT char* Dart_Initialize( | 1134 DART_EXPORT char* Dart_Initialize( |
1135 const uint8_t* vm_isolate_snapshot, | 1135 const uint8_t* vm_isolate_snapshot, |
1136 const uint8_t* instructions_snapshot, | 1136 const uint8_t* instructions_snapshot, |
1137 const uint8_t* data_snapshot, | 1137 const uint8_t* data_snapshot, |
1138 Dart_IsolateCreateCallback create, | 1138 Dart_IsolateCreateCallback create, |
1139 Dart_IsolateInterruptCallback interrupt, | 1139 Dart_IsolateInterruptCallback interrupt, |
1140 Dart_IsolateUnhandledExceptionCallback unhandled, | 1140 Dart_IsolateUnhandledExceptionCallback unhandled, |
1141 Dart_IsolateShutdownCallback shutdown, | 1141 Dart_IsolateShutdownCallback shutdown, |
| 1142 Dart_ThreadExitCallback thread_exit, |
1142 Dart_FileOpenCallback file_open, | 1143 Dart_FileOpenCallback file_open, |
1143 Dart_FileReadCallback file_read, | 1144 Dart_FileReadCallback file_read, |
1144 Dart_FileWriteCallback file_write, | 1145 Dart_FileWriteCallback file_write, |
1145 Dart_FileCloseCallback file_close, | 1146 Dart_FileCloseCallback file_close, |
1146 Dart_EntropySource entropy_source, | 1147 Dart_EntropySource entropy_source, |
1147 Dart_GetVMServiceAssetsArchive get_service_assets) { | 1148 Dart_GetVMServiceAssetsArchive get_service_assets) { |
1148 if ((instructions_snapshot != NULL) && !FLAG_precompiled_runtime) { | 1149 if ((instructions_snapshot != NULL) && !FLAG_precompiled_runtime) { |
1149 return strdup("Flag --precompilation was not specified."); | 1150 return strdup("Flag --precompilation was not specified."); |
1150 } | 1151 } |
1151 if (interrupt != NULL) { | 1152 if (interrupt != NULL) { |
1152 return strdup("Dart_Initialize: " | 1153 return strdup("Dart_Initialize: " |
1153 "Setting of interrupt callback is not supported."); | 1154 "Setting of interrupt callback is not supported."); |
1154 } | 1155 } |
1155 if (unhandled != NULL) { | 1156 if (unhandled != NULL) { |
1156 return strdup("Dart_Initialize: " | 1157 return strdup("Dart_Initialize: " |
1157 "Setting of unhandled exception callback is not supported."); | 1158 "Setting of unhandled exception callback is not supported."); |
1158 } | 1159 } |
1159 const char* err_msg = Dart::InitOnce(vm_isolate_snapshot, | 1160 const char* err_msg = Dart::InitOnce(vm_isolate_snapshot, |
1160 instructions_snapshot, | 1161 instructions_snapshot, |
1161 data_snapshot, | 1162 data_snapshot, |
1162 create, shutdown, | 1163 create, shutdown, |
| 1164 thread_exit, |
1163 file_open, file_read, file_write, | 1165 file_open, file_read, file_write, |
1164 file_close, entropy_source, | 1166 file_close, entropy_source, |
1165 get_service_assets); | 1167 get_service_assets); |
1166 if (err_msg != NULL) { | 1168 if (err_msg != NULL) { |
1167 return strdup(err_msg); | 1169 return strdup(err_msg); |
1168 } | 1170 } |
1169 return NULL; | 1171 return NULL; |
1170 } | 1172 } |
1171 | 1173 |
1172 | 1174 |
(...skipping 5021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6194 return Api::Success(); | 6196 return Api::Success(); |
6195 } | 6197 } |
6196 #endif // DART_PRECOMPILER | 6198 #endif // DART_PRECOMPILER |
6197 | 6199 |
6198 | 6200 |
6199 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 6201 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
6200 return Dart::IsRunningPrecompiledCode(); | 6202 return Dart::IsRunningPrecompiledCode(); |
6201 } | 6203 } |
6202 | 6204 |
6203 } // namespace dart | 6205 } // namespace dart |
OLD | NEW |