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

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: 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
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index a3d3da68fce35bfd974c2699c8a87779c25978cb..e1c7567fe81915ed34aeac9b335da3380ae2c193 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,15 @@ 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);
+ if (kernel_program != NULL) {
Kevin Millikin (Google) 2016/11/22 15:51:17 Here you can just unconditionally call Object::Ini
kustermann 2016/11/23 08:31:46 Done.
+ error = Object::Init(I, kernel_program);
} else {
- error = Object::Init(I, NULL, -1);
+ error = Object::Init(I, NULL);
}
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 +561,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 +589,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();

Powered by Google App Engine
This is Rietveld 408576698