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

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: 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') | runtime/bin/loader.cc » ('J')
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 53babb7c9ae823aa44e9bbe500a8ebba655c5cc2..4817a7a7cc9408a3c32e620c0f724bb2d961fc71 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -1270,9 +1270,16 @@ 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_ParseKernelBinary(kernel, kernel_length);
+ free(const_cast<uint8_t*>(kernel));
+ }
+
Dart_Isolate isolate =
is_kernel_file
- ? Dart_CreateIsolateFromKernel(NULL, NULL, kernel, kernel_length,
+ ? Dart_CreateIsolateFromKernel(NULL, NULL, kernel_program,
NULL, isolate_data, &error)
: Dart_CreateIsolate(NULL, NULL, NULL, NULL, isolate_data, &error);
if (isolate == NULL) {
@@ -1293,8 +1300,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') | runtime/bin/loader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698