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

Unified Diff: runtime/vm/clustered_snapshot.cc

Issue 2822843002: Use to_snapshot when cluster serializing LibraryPrefixes. (Closed)
Patch Set: ports -> imports/exports Created 3 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 | « no previous file | runtime/vm/object_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/clustered_snapshot.cc
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index d57951938a1e4f10af0e618cdd004df720061119..b8a9aaac678dfb6e74756586aadb76784b51e8a0 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -2860,7 +2860,7 @@ class LibraryPrefixSerializationCluster : public SerializationCluster {
objects_.Add(prefix);
RawObject** from = prefix->from();
- RawObject** to = prefix->to();
+ RawObject** to = prefix->to_snapshot(s->kind());
for (RawObject** p = from; p <= to; p++) {
s->Push(*p);
}
@@ -2877,11 +2877,12 @@ class LibraryPrefixSerializationCluster : public SerializationCluster {
}
void WriteFill(Serializer* s) {
+ Snapshot::Kind kind = s->kind();
intptr_t count = objects_.length();
for (intptr_t i = 0; i < count; i++) {
RawLibraryPrefix* prefix = objects_[i];
RawObject** from = prefix->from();
- RawObject** to = prefix->to();
+ RawObject** to = prefix->to_snapshot(kind);
for (RawObject** p = from; p <= to; p++) {
s->WriteRef(*p);
}
@@ -2913,6 +2914,7 @@ class LibraryPrefixDeserializationCluster : public DeserializationCluster {
}
void ReadFill(Deserializer* d) {
+ Snapshot::Kind kind = d->kind();
bool is_vm_object = d->isolate() == Dart::vm_isolate();
for (intptr_t id = start_index_; id < stop_index_; id++) {
@@ -2922,10 +2924,15 @@ class LibraryPrefixDeserializationCluster : public DeserializationCluster {
LibraryPrefix::InstanceSize(),
is_vm_object);
RawObject** from = prefix->from();
+ RawObject** to_snapshot = prefix->to_snapshot(kind);
RawObject** to = prefix->to();
- for (RawObject** p = from; p <= to; p++) {
+ for (RawObject** p = from; p <= to_snapshot; p++) {
*p = d->ReadRef();
}
+ for (RawObject** p = to_snapshot + 1; p <= to; p++) {
+ *p = Object::null();
+ }
+
prefix->ptr()->num_imports_ = d->Read<uint16_t>();
prefix->ptr()->is_deferred_load_ = d->Read<bool>();
prefix->ptr()->is_loaded_ = !prefix->ptr()->is_deferred_load_;
« no previous file with comments | « no previous file | runtime/vm/object_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698