Chromium Code Reviews| Index: runtime/vm/snapshot.cc |
| diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc |
| index 85099cca5c331ac19b8e367b8c48f82a4de8efe0..f6b2023dc5b9750f6df942023df605e56f577a84 100644 |
| --- a/runtime/vm/snapshot.cc |
| +++ b/runtime/vm/snapshot.cc |
| @@ -198,6 +198,8 @@ SnapshotReader::SnapshotReader( |
| data_(ExternalTypedData::Handle(zone_)), |
| typed_data_(TypedData::Handle(zone_)), |
| code_(Code::Handle(zone_)), |
| + function_(Function::Handle(zone_)), |
| + megamorphic_cache_(MegamorphicCache::Handle(zone_)), |
| error_(UnhandledException::Handle(zone_)), |
| max_vm_isolate_object_id_( |
| (kind == Snapshot::kFull) ? |
| @@ -664,6 +666,9 @@ RawApiError* SnapshotReader::ReadFullSnapshot() { |
| for (intptr_t i = 0; i <= num_flds; i++) { |
| *(object_store->from() + i) = ReadObjectImpl(kAsInlinedObject); |
| } |
| + if (snapshot_code_) { |
| + isolate->megamorphic_cache_table()->ReadFrom(this); |
| + } |
| for (intptr_t i = 0; i < backward_references_->length(); i++) { |
| if (!(*backward_references_)[i].is_deserialized()) { |
| ReadObjectImpl(kAsInlinedObject); |
| @@ -1541,9 +1546,8 @@ RawApiError* VmIsolateSnapshotReader::ReadVmIsolateSnapshot() { |
| ExceptionHandlers::CheckedHandle(ReadObject()); // empty exc handlers |
| #define READ_STUB(name) \ |
| - *(CodeHandle()) ^= ReadObject(); |
| - // TODO(rmacnak): |
| - // StubCode::name##_entry()->InitOnceFromSnapshot(CodeHandle()) |
| + *(CodeHandle()) ^= ReadObject(); \ |
| + StubCode::name##_entry_ = new StubEntry(*CodeHandle()); |
|
siva
2015/09/14 20:32:59
Instead of exposing the stub code macro order here
rmacnak
2015/09/15 17:56:42
Pushed to stub_code.cc and added TODO.
|
| VM_STUB_CODE_LIST(READ_STUB); |
| #undef READ_STUB |
| } |
| @@ -1569,6 +1573,7 @@ IsolateSnapshotReader::IsolateSnapshotReader(const uint8_t* buffer, |
| new ZoneGrowableArray<BackRefNode>( |
| kNumInitialReferencesInFullSnapshot), |
| thread) { |
| + Isolate::Current()->set_compilation_allowed(instructions_buffer_ == NULL); |
| } |
| @@ -1996,6 +2001,10 @@ void FullSnapshotWriter::WriteIsolateFullSnapshot() { |
| SnapshotWriterVisitor visitor(&writer, false); |
| object_store->VisitObjectPointers(&visitor); |
| + if (snapshot_code_) { |
| + isolate_->megamorphic_cache_table()->WriteTo(&writer); |
| + } |
|
siva
2015/09/14 20:32:59
Why do you order this in between the object_store
rmacnak
2015/09/15 17:56:42
Dropped.
|
| + |
| // Write out all forwarded objects. |
| writer.WriteForwardedObjects(); |