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

Unified Diff: runtime/vm/snapshot.cc

Issue 1900863002: Reapply "- Use a hash table to canonicalize instances/arrays to avoid having to iterate over a line… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index c455d302f77a326acf8774258d02db40eab8c49c..936acbd5364ae84662b610be2f9eda945e8f28fd 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -542,7 +542,7 @@ RawObject* SnapshotReader::ReadInstance(intptr_t object_id,
if (kind_ == Snapshot::kFull) {
result->SetCanonical();
} else {
- *result = result->CheckAndCanonicalize(NULL);
+ *result = result->CheckAndCanonicalize(thread(), NULL);
ASSERT(!result->IsNull());
}
}
@@ -647,7 +647,6 @@ RawApiError* SnapshotReader::ReadFullSnapshot() {
}
}
-
// Validate the class table.
#if defined(DEBUG)
isolate->ValidateClassTable();
@@ -655,8 +654,17 @@ RawApiError* SnapshotReader::ReadFullSnapshot() {
// Setup native resolver for bootstrap impl.
Bootstrap::SetupNativeResolver();
- return ApiError::null();
}
+
+ Class& cls = Class::Handle(thread->zone());
+ for (intptr_t i = 0; i < backward_references_->length(); i++) {
+ if ((*backward_references_)[i].reference()->IsClass()) {
+ cls ^= (*backward_references_)[i].reference()->raw();
+ cls.RehashConstants(thread->zone());
+ }
+ }
+
+ return ApiError::null();
}
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698