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

Unified Diff: runtime/vm/object.cc

Issue 1588783002: Do not include resolved_names_ and loaded_scripts_ consistently in both the full and script snapsho… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: adjust_comment Created 4 years, 11 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 730d5605b16b7a2f2cfa1bd21d8272a3950a61e1..5985cc6bcb7fb77e274ac16a1538a8821e00b9e4 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -10155,9 +10155,17 @@ static RawArray* NewDictionary(intptr_t initial_size) {
}
-void Library::InitResolvedNamesCache(intptr_t size) const {
- const Array& cache = Array::Handle(HashTables::New<ResolvedNamesMap>(size));
- StorePointer(&raw_ptr()->resolved_names_, cache.raw());
+void Library::InitResolvedNamesCache(intptr_t size,
+ SnapshotReader* reader) const {
+ if (reader == NULL) {
+ StorePointer(&raw_ptr()->resolved_names_,
+ HashTables::New<ResolvedNamesMap>(size));
+ } else {
+ intptr_t len = ResolvedNamesMap::ArrayLengthForNumOccupied(size);
+ *reader->ArrayHandle() ^= reader->NewArray(len);
+ StorePointer(&raw_ptr()->resolved_names_,
+ HashTables::New<ResolvedNamesMap>(*reader->ArrayHandle()));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698