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

Unified Diff: runtime/vm/bootstrap.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.h ('k') | runtime/vm/bootstrap_nocore.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bootstrap.cc
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index 84b528d4c9a7127e1f6f3639adc6bb9c64af06df..113dcd9d3f0dc0a667ec635ce0c0959a53ef382f 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -317,17 +317,9 @@ static RawError* BootstrapFromSource(Thread* thread) {
#if !defined(DART_PRECOMPILED_RUNTIME)
-static RawError* BootstrapFromKernel(Thread* thread,
- const uint8_t* buffer,
- intptr_t buffer_size) {
+static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {
Zone* zone = thread->zone();
- kernel::KernelReader reader(buffer, buffer_size);
- 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
@@ -363,17 +355,14 @@ static RawError* BootstrapFromKernel(Thread* thread,
return Error::null();
}
#else
-static RawError* BootstrapFromKernel(Thread* thread,
- const uint8_t* buffer,
- intptr_t buffer_size) {
+static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {
UNREACHABLE();
return Error::null();
}
#endif
-RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer,
- intptr_t kernel_buffer_length) {
+RawError* Bootstrap::DoBootstrapping(kernel::Program* kernel_program) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
Zone* zone = thread->zone();
@@ -396,9 +385,8 @@ RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer,
}
}
- return (kernel_buffer == NULL)
- ? BootstrapFromSource(thread)
- : BootstrapFromKernel(thread, kernel_buffer, kernel_buffer_length);
+ return (kernel_program == NULL) ? BootstrapFromSource(thread)
+ : BootstrapFromKernel(thread, kernel_program);
}
} // namespace dart
« no previous file with comments | « runtime/vm/bootstrap.h ('k') | runtime/vm/bootstrap_nocore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698