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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 2525623002: VM: [Kernel] Split kernel API into 3 steps: ([read binary], parse-binary, bootstrap, load program) (Closed)
Patch Set: addressed comments 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
« no previous file with comments | « no previous file | runtime/bin/loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/gen_snapshot.cc
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 8e2efdaab3655093c4e0a3934d98c88298902156..cabfe009b0951ac9bb3e25f802b247103e13c2ed 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -1296,10 +1296,17 @@ int main(int argc, char** argv) {
intptr_t kernel_length = 0;
const bool is_kernel_file =
TryReadKernel(app_script_name, &kernel, &kernel_length);
+
+ void* kernel_program = NULL;
+ if (is_kernel_file) {
+ kernel_program = Dart_ReadKernelBinary(kernel, kernel_length);
+ free(const_cast<uint8_t*>(kernel));
+ }
+
Dart_Isolate isolate =
is_kernel_file
- ? Dart_CreateIsolateFromKernel(NULL, NULL, kernel, kernel_length,
- NULL, isolate_data, &error)
+ ? Dart_CreateIsolateFromKernel(NULL, NULL, kernel_program, NULL,
+ isolate_data, &error)
: Dart_CreateIsolate(NULL, NULL, NULL, NULL, isolate_data, &error);
if (isolate == NULL) {
Log::PrintErr("%s", error);
@@ -1319,8 +1326,7 @@ int main(int argc, char** argv) {
ParseEntryPointsManifestIfPresent();
if (is_kernel_file) {
- Dart_Handle library = Dart_LoadKernel(kernel, kernel_length);
- free(const_cast<uint8_t*>(kernel));
+ Dart_Handle library = Dart_LoadKernel(kernel_program);
if (Dart_IsError(library)) FATAL("Failed to load app from Kernel IR");
} else {
// Set up the library tag handler in such a manner that it will use the
« no previous file with comments | « no previous file | runtime/bin/loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698