Chromium Code Reviews| Index: runtime/vm/clustered_snapshot.cc |
| diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc |
| index 6faedb87a23dae15fbf864d935d0e3cc658d68dc..37fa7c902c5dcf6f6cb3da244a7ebdccd9082845 100644 |
| --- a/runtime/vm/clustered_snapshot.cc |
| +++ b/runtime/vm/clustered_snapshot.cc |
| @@ -4717,6 +4717,7 @@ void Serializer::Serialize() { |
| } |
| #endif |
| + Write<int32_t>(num_base_objects_); |
| Write<int32_t>(num_objects); |
| Write<int32_t>(num_clusters); |
| @@ -5090,6 +5091,7 @@ RawApiError* Deserializer::VerifyVersionAndFeatures(Isolate* isolate) { |
| void Deserializer::Prepare() { |
| + num_base_objects_ = Read<int32_t>(); |
| num_objects_ = Read<int32_t>(); |
| num_clusters_ = Read<int32_t>(); |
| @@ -5099,7 +5101,11 @@ void Deserializer::Prepare() { |
| void Deserializer::Deserialize() { |
| - // TODO(rmacnak): Verify num of base objects. |
| + if (num_base_objects_ != (next_ref_index_ - 1)) { |
| + FATAL2("Snapshot expects %" Pd |
| + " base objects, but deserializer provided %" Pd, |
| + num_base_objects_, next_ref_index_ - 1); |
| + } |
| { |
| NOT_IN_PRODUCT(TimelineDurationScope tds( |
| @@ -5356,7 +5362,11 @@ FullSnapshotWriter::FullSnapshotWriter(Snapshot::Kind kind, |
| // Can't have any mutation happening while we're serializing. |
| ASSERT(isolate()->background_compiler() == NULL); |
| - if (vm_snapshot_data_buffer != NULL) { |
| + // TODO(rmacnak): The special case for AOT causes us to always generate the |
| + // same VM isolate snapshot for every app. This should be cleaned up so the VM |
| + // isolate snapshot is generated separately and each app is generated from a |
| + // VM that has loaded this snapshots, much like app-jit snapshots. |
|
siva
2017/04/06 19:19:40
this snapshot?
rmacnak
2017/04/06 20:09:48
Clarified comment that it is AOT snapshots which n
|
| + if ((vm_snapshot_data_buffer != NULL) && (kind != Snapshot::kAppAOT)) { |
| NOT_IN_PRODUCT(TimelineDurationScope tds( |
| thread(), Timeline::GetIsolateStream(), "PrepareNewVMIsolate")); |
| @@ -5386,6 +5396,8 @@ FullSnapshotWriter::FullSnapshotWriter(Snapshot::Kind kind, |
| Symbols::SetupSymbolTable(isolate()); |
| } else { |
| // Reuse the current vm isolate. |
| + saved_symbol_table_ = object_store->symbol_table(); |
| + new_vm_symbol_table_ = Dart::vm_isolate()->object_store()->symbol_table(); |
| } |
| } |