Chromium Code Reviews| 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(); |