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

Unified Diff: runtime/vm/bootstrap_nocore.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 | « runtime/vm/bootstrap.cc ('k') | runtime/vm/dart.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bootstrap_nocore.cc
diff --git a/runtime/vm/bootstrap_nocore.cc b/runtime/vm/bootstrap_nocore.cc
index cd49589fa7c3e582c5de5eb182089532a20fd5a9..74367a1d6406facda5d50df1dbd4b2e7c009d9bf 100644
--- a/runtime/vm/bootstrap_nocore.cc
+++ b/runtime/vm/bootstrap_nocore.cc
@@ -55,18 +55,9 @@ void Finish(Thread* thread, bool from_kernel) {
}
-RawError* BootstrapFromKernel(Thread* thread,
- const uint8_t* buffer,
- intptr_t buffer_length) {
+RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {
Zone* zone = thread->zone();
- kernel::KernelReader reader(buffer, buffer_length);
- kernel::Program* program = reader.ReadPrecompiledProgram();
- if (program == NULL) {
- const String& message =
- String::Handle(zone, String::New("Failed to read Kernel file"));
- return ApiError::New(message);
- }
-
+ kernel::KernelReader reader(program);
Isolate* isolate = thread->isolate();
// Mark the already-pending classes. This mark bit will be used to avoid
// adding classes to the list more than once.
@@ -102,8 +93,7 @@ RawError* BootstrapFromKernel(Thread* thread,
}
-RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer,
- intptr_t kernel_buffer_length) {
+RawError* Bootstrap::DoBootstrapping(kernel::Program* program) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
Zone* zone = thread->zone();
@@ -126,12 +116,10 @@ RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer,
}
}
- ASSERT(kernel_buffer != NULL);
- return BootstrapFromKernel(thread, kernel_buffer, kernel_buffer_length);
+ return BootstrapFromKernel(thread, program);
}
#else
-RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer,
- intptr_t kernel_buffer_length) {
+RawError* Bootstrap::DoBootstrapping(kernel::Program* program) {
UNREACHABLE();
return Error::null();
}
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/dart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698