Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1584443002: VM: Precompiled rodata snapshot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: win32, android build Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 1112
1113 // --- Initialization and Globals --- 1113 // --- Initialization and Globals ---
1114 1114
1115 DART_EXPORT const char* Dart_VersionString() { 1115 DART_EXPORT const char* Dart_VersionString() {
1116 return Version::String(); 1116 return Version::String();
1117 } 1117 }
1118 1118
1119 DART_EXPORT char* Dart_Initialize( 1119 DART_EXPORT char* Dart_Initialize(
1120 const uint8_t* vm_isolate_snapshot, 1120 const uint8_t* vm_isolate_snapshot,
1121 const uint8_t* instructions_snapshot, 1121 const uint8_t* instructions_snapshot,
1122 const uint8_t* data_snapshot,
1122 Dart_IsolateCreateCallback create, 1123 Dart_IsolateCreateCallback create,
1123 Dart_IsolateInterruptCallback interrupt, 1124 Dart_IsolateInterruptCallback interrupt,
1124 Dart_IsolateUnhandledExceptionCallback unhandled, 1125 Dart_IsolateUnhandledExceptionCallback unhandled,
1125 Dart_IsolateShutdownCallback shutdown, 1126 Dart_IsolateShutdownCallback shutdown,
1126 Dart_FileOpenCallback file_open, 1127 Dart_FileOpenCallback file_open,
1127 Dart_FileReadCallback file_read, 1128 Dart_FileReadCallback file_read,
1128 Dart_FileWriteCallback file_write, 1129 Dart_FileWriteCallback file_write,
1129 Dart_FileCloseCallback file_close, 1130 Dart_FileCloseCallback file_close,
1130 Dart_EntropySource entropy_source, 1131 Dart_EntropySource entropy_source,
1131 Dart_GetVMServiceAssetsArchive get_service_assets) { 1132 Dart_GetVMServiceAssetsArchive get_service_assets) {
1132 if ((instructions_snapshot != NULL) && !FLAG_precompilation) { 1133 if ((instructions_snapshot != NULL) && !FLAG_precompilation) {
1133 return strdup("Flag --precompilation was not specified."); 1134 return strdup("Flag --precompilation was not specified.");
1134 } 1135 }
1135 if (interrupt != NULL) { 1136 if (interrupt != NULL) {
1136 return strdup("Dart_Initialize: " 1137 return strdup("Dart_Initialize: "
1137 "Setting of interrupt callback is not supported."); 1138 "Setting of interrupt callback is not supported.");
1138 } 1139 }
1139 if (unhandled != NULL) { 1140 if (unhandled != NULL) {
1140 return strdup("Dart_Initialize: " 1141 return strdup("Dart_Initialize: "
1141 "Setting of unhandled exception callback is not supported."); 1142 "Setting of unhandled exception callback is not supported.");
1142 } 1143 }
1143 const char* err_msg = Dart::InitOnce(vm_isolate_snapshot, 1144 const char* err_msg = Dart::InitOnce(vm_isolate_snapshot,
1144 instructions_snapshot, 1145 instructions_snapshot,
1146 data_snapshot,
1145 create, shutdown, 1147 create, shutdown,
1146 file_open, file_read, file_write, 1148 file_open, file_read, file_write,
1147 file_close, entropy_source, 1149 file_close, entropy_source,
1148 get_service_assets); 1150 get_service_assets);
1149 if (err_msg != NULL) { 1151 if (err_msg != NULL) {
1150 return strdup(err_msg); 1152 return strdup(err_msg);
1151 } 1153 }
1152 return NULL; 1154 return NULL;
1153 } 1155 }
1154 1156
(...skipping 4823 matching lines...) Expand 10 before | Expand all | Expand 10 after
5978 return Api::Success(); 5980 return Api::Success();
5979 } 5981 }
5980 #endif // DART_PRECOMPILED 5982 #endif // DART_PRECOMPILED
5981 5983
5982 5984
5983 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { 5985 DART_EXPORT bool Dart_IsRunningPrecompiledCode() {
5984 return Dart::IsRunningPrecompiledCode(); 5986 return Dart::IsRunningPrecompiledCode();
5985 } 5987 }
5986 5988
5987 } // namespace dart 5989 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/heap.h » ('j') | runtime/vm/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698