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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 1902563002: Add per-library cache of exported names (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 unified diff | Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/native_entry.h" 5 #include "vm/native_entry.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 } 1175 }
1176 // Initialize cache of resolved names. 1176 // Initialize cache of resolved names.
1177 const intptr_t kInitialNameCacheSize = 64; 1177 const intptr_t kInitialNameCacheSize = 64;
1178 if (kind != Snapshot::kFull) { 1178 if (kind != Snapshot::kFull) {
1179 // The cache of resolved names in library scope is not serialized. 1179 // The cache of resolved names in library scope is not serialized.
1180 library.InitResolvedNamesCache(kInitialNameCacheSize); 1180 library.InitResolvedNamesCache(kInitialNameCacheSize);
1181 library.Register(); 1181 library.Register();
1182 } else { 1182 } else {
1183 library.InitResolvedNamesCache(kInitialNameCacheSize, reader); 1183 library.InitResolvedNamesCache(kInitialNameCacheSize, reader);
1184 } 1184 }
1185 library.StorePointer(&library.raw_ptr()->exported_names_, Array::null());
1185 // Initialize cache of loaded scripts. 1186 // Initialize cache of loaded scripts.
1186 library.StorePointer(&library.raw_ptr()->loaded_scripts_, Array::null()); 1187 library.StorePointer(&library.raw_ptr()->loaded_scripts_, Array::null());
1187 } 1188 }
1188 return library.raw(); 1189 return library.raw();
1189 } 1190 }
1190 1191
1191 1192
1192 void RawLibrary::WriteTo(SnapshotWriter* writer, 1193 void RawLibrary::WriteTo(SnapshotWriter* writer,
1193 intptr_t object_id, 1194 intptr_t object_id,
1194 Snapshot::Kind kind, 1195 Snapshot::Kind kind,
(...skipping 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after
3709 // We do not allow objects with native fields in an isolate message. 3710 // We do not allow objects with native fields in an isolate message.
3710 writer->SetWriteException(Exceptions::kArgument, 3711 writer->SetWriteException(Exceptions::kArgument,
3711 "Illegal argument in isolate message" 3712 "Illegal argument in isolate message"
3712 " : (object is a UserTag)"); 3713 " : (object is a UserTag)");
3713 } else { 3714 } else {
3714 UNREACHABLE(); 3715 UNREACHABLE();
3715 } 3716 }
3716 } 3717 }
3717 3718
3718 } // namespace dart 3719 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698