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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 2485993002: VM: Support bootstrapping core libraries from Kernel binaries instead of source. (Closed)
Patch Set: Done Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/gen_snapshot.cc
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 17acc09fcd58da6d6c0b6ad2c5f1da1933aa995e..5d971eff441093dc1d42738474d67860ae6aa9c1 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -1266,8 +1266,16 @@ int main(int argc, char** argv) {
// Now we create an isolate into which we load all the code that needs to
// be in the snapshot.
isolate_data = new IsolateData(NULL, NULL, NULL);
- if (Dart_CreateIsolate(NULL, NULL, NULL, NULL, isolate_data, &error) ==
- NULL) {
+ intptr_t payload_bytes = 0;
+ const uint8_t* payload = NULL;
siva 2016/11/16 05:49:34 Maybe names like kernel_length and kernel would be
Vyacheslav Egorov (Google) 2016/11/16 12:47:46 Done.
+ const bool is_kernel_file =
+ TryReadKernel(app_script_name, &payload, &payload_bytes);
+ Dart_Isolate isolate =
+ is_kernel_file
+ ? Dart_CreateIsolateFromKernel(NULL, NULL, payload, payload_bytes,
+ NULL, isolate_data, &error)
+ : Dart_CreateIsolate(NULL, NULL, NULL, NULL, isolate_data, &error);
+ if (isolate == NULL) {
fprintf(stderr, "%s", error);
free(error);
exit(255);
@@ -1284,11 +1292,6 @@ int main(int argc, char** argv) {
Dart_QualifiedFunctionName* entry_points =
ParseEntryPointsManifestIfPresent();
- intptr_t payload_bytes = 0;
- const uint8_t* payload = NULL;
- const bool is_kernel_file =
- TryReadKernel(app_script_name, &payload, &payload_bytes);
-
if (is_kernel_file) {
Dart_Handle library = Dart_LoadKernel(payload, payload_bytes);
free(const_cast<uint8_t*>(payload));
« no previous file with comments | « runtime/bin/builtin.cc ('k') | runtime/bin/main.cc » ('j') | runtime/bin/main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698