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

Unified Diff: runtime/vm/dart.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/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index a3d3da68fce35bfd974c2699c8a87779c25978cb..07547deb87347f40a619506277052daf862dd358 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -493,7 +493,7 @@ Isolate* Dart::CreateIsolate(const char* name_prefix,
RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer,
intptr_t snapshot_length,
- bool from_kernel,
+ kernel::Program* kernel_program,
void* data) {
// Initialize the new isolate.
Thread* T = Thread::Current();
@@ -512,17 +512,11 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer,
}
Error& error = Error::Handle(T->zone());
- if (from_kernel) {
- ASSERT(snapshot_buffer != NULL);
- ASSERT(snapshot_length > 0);
- error = Object::Init(I, snapshot_buffer, snapshot_length);
- } else {
- error = Object::Init(I, NULL, -1);
- }
+ error = Object::Init(I, kernel_program);
if (!error.IsNull()) {
return error.raw();
}
- if ((snapshot_buffer != NULL) && !from_kernel) {
+ if ((snapshot_buffer != NULL) && kernel_program == NULL) {
// Read the snapshot and setup the initial state.
NOT_IN_PRODUCT(TimelineDurationScope tds(T, Timeline::GetIsolateStream(),
"IsolateSnapshotReader"));
@@ -563,7 +557,7 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer,
MegamorphicCacheTable::PrintSizes(I);
}
} else {
- if ((snapshot_kind_ != Snapshot::kNone) && !from_kernel) {
+ if ((snapshot_kind_ != Snapshot::kNone) && kernel_program == NULL) {
const String& message =
String::Handle(String::New("Missing isolate snapshot"));
return ApiError::New(message);
@@ -591,7 +585,7 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer,
Code::Handle(I->object_store()->megamorphic_miss_code());
I->set_ic_miss_code(miss_code);
- if ((snapshot_buffer == NULL) || from_kernel) {
+ if ((snapshot_buffer == NULL) || (kernel_program != NULL)) {
const Error& error = Error::Handle(I->object_store()->PreallocateObjects());
if (!error.IsNull()) {
return error.raw();
« no previous file with comments | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698