| 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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 | 1131 |
| 1132 // --- Initialization and Globals --- | 1132 // --- Initialization and Globals --- |
| 1133 | 1133 |
| 1134 DART_EXPORT const char* Dart_VersionString() { | 1134 DART_EXPORT const char* Dart_VersionString() { |
| 1135 return Version::String(); | 1135 return Version::String(); |
| 1136 } | 1136 } |
| 1137 | 1137 |
| 1138 DART_EXPORT char* Dart_Initialize( | 1138 DART_EXPORT char* Dart_Initialize( |
| 1139 const uint8_t* vm_isolate_snapshot, | 1139 const uint8_t* vm_isolate_snapshot, |
| 1140 const uint8_t* instructions_snapshot, | 1140 const uint8_t* instructions_snapshot, |
| 1141 const uint8_t* data_snapshot, |
| 1141 Dart_IsolateCreateCallback create, | 1142 Dart_IsolateCreateCallback create, |
| 1142 Dart_IsolateInterruptCallback interrupt, | 1143 Dart_IsolateInterruptCallback interrupt, |
| 1143 Dart_IsolateUnhandledExceptionCallback unhandled, | 1144 Dart_IsolateUnhandledExceptionCallback unhandled, |
| 1144 Dart_IsolateShutdownCallback shutdown, | 1145 Dart_IsolateShutdownCallback shutdown, |
| 1145 Dart_FileOpenCallback file_open, | 1146 Dart_FileOpenCallback file_open, |
| 1146 Dart_FileReadCallback file_read, | 1147 Dart_FileReadCallback file_read, |
| 1147 Dart_FileWriteCallback file_write, | 1148 Dart_FileWriteCallback file_write, |
| 1148 Dart_FileCloseCallback file_close, | 1149 Dart_FileCloseCallback file_close, |
| 1149 Dart_EntropySource entropy_source, | 1150 Dart_EntropySource entropy_source, |
| 1150 Dart_GetVMServiceAssetsArchive get_service_assets) { | 1151 Dart_GetVMServiceAssetsArchive get_service_assets) { |
| 1151 if ((instructions_snapshot != NULL) && !FLAG_precompilation) { | 1152 if ((instructions_snapshot != NULL) && !FLAG_precompilation) { |
| 1152 return strdup("Flag --precompilation was not specified."); | 1153 return strdup("Flag --precompilation was not specified."); |
| 1153 } | 1154 } |
| 1154 if (interrupt != NULL) { | 1155 if (interrupt != NULL) { |
| 1155 return strdup("Dart_Initialize: " | 1156 return strdup("Dart_Initialize: " |
| 1156 "Setting of interrupt callback is not supported."); | 1157 "Setting of interrupt callback is not supported."); |
| 1157 } | 1158 } |
| 1158 if (unhandled != NULL) { | 1159 if (unhandled != NULL) { |
| 1159 return strdup("Dart_Initialize: " | 1160 return strdup("Dart_Initialize: " |
| 1160 "Setting of unhandled exception callback is not supported."); | 1161 "Setting of unhandled exception callback is not supported."); |
| 1161 } | 1162 } |
| 1162 const char* err_msg = Dart::InitOnce(vm_isolate_snapshot, | 1163 const char* err_msg = Dart::InitOnce(vm_isolate_snapshot, |
| 1163 instructions_snapshot, | 1164 instructions_snapshot, |
| 1165 data_snapshot, |
| 1164 create, shutdown, | 1166 create, shutdown, |
| 1165 file_open, file_read, file_write, | 1167 file_open, file_read, file_write, |
| 1166 file_close, entropy_source, | 1168 file_close, entropy_source, |
| 1167 get_service_assets); | 1169 get_service_assets); |
| 1168 if (err_msg != NULL) { | 1170 if (err_msg != NULL) { |
| 1169 return strdup(err_msg); | 1171 return strdup(err_msg); |
| 1170 } | 1172 } |
| 1171 return NULL; | 1173 return NULL; |
| 1172 } | 1174 } |
| 1173 | 1175 |
| (...skipping 4994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6168 return Api::Success(); | 6170 return Api::Success(); |
| 6169 } | 6171 } |
| 6170 #endif // DART_PRECOMPILER | 6172 #endif // DART_PRECOMPILER |
| 6171 | 6173 |
| 6172 | 6174 |
| 6173 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 6175 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
| 6174 return Dart::IsRunningPrecompiledCode(); | 6176 return Dart::IsRunningPrecompiledCode(); |
| 6175 } | 6177 } |
| 6176 | 6178 |
| 6177 } // namespace dart | 6179 } // namespace dart |
| OLD | NEW |