| Index: runtime/vm/megamorphic_cache_table.cc
|
| diff --git a/runtime/vm/megamorphic_cache_table.cc b/runtime/vm/megamorphic_cache_table.cc
|
| index 3bbc5291fc9fcd925c96c623c6cba1e8adac1b44..42a214f10214bb3e2fd2c0924861ec11cba6fb15 100644
|
| --- a/runtime/vm/megamorphic_cache_table.cc
|
| +++ b/runtime/vm/megamorphic_cache_table.cc
|
| @@ -102,4 +102,40 @@ void MegamorphicCacheTable::PrintSizes() {
|
| length_, size / 1024);
|
| }
|
|
|
| +
|
| +void MegamorphicCacheTable::ReadFrom(SnapshotReader* reader) {
|
| + ASSERT(reader->snapshot_code());
|
| +
|
| + *reader->FunctionHandle() ^= reader->ReadObject();
|
| + miss_handler_function_ = reader->FunctionHandle()->raw();
|
| + miss_handler_code_ = reader->FunctionHandle()->CurrentCode();
|
| +
|
| + capacity_ = reader->Read<intptr_t>();
|
| + length_ = capacity_;
|
| +
|
| + table_ = reinterpret_cast<Entry*>(malloc(length_ * sizeof(*table_)));
|
| + for (intptr_t i = 0; i < length_; ++i) {
|
| + *reader->StringHandle() ^= reader->ReadObject();
|
| + table_[i].name = reader->StringHandle()->raw();
|
| + *reader->ArrayHandle() ^= reader->ReadObject();
|
| + table_[i].descriptor = reader->ArrayHandle()->raw();
|
| + *reader->MegamorphicCacheHandle() ^= reader->ReadObject();
|
| + table_[i].cache = reader->MegamorphicCacheHandle()->raw();
|
| + }
|
| +}
|
| +
|
| +
|
| +void MegamorphicCacheTable::WriteTo(SnapshotWriter* writer) {
|
| + ASSERT(writer->snapshot_code());
|
| +
|
| + writer->WriteObject(miss_handler_function_);
|
| + writer->Write<intptr_t>(length_);
|
| + for (intptr_t i = 0; i < length_; i++) {
|
| + writer->WriteObject(table_[i].name);
|
| + writer->WriteObject(table_[i].descriptor);
|
| + writer->WriteObject(table_[i].cache);
|
| + }
|
| +}
|
| +
|
| +
|
| } // namespace dart
|
|
|