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