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

Unified Diff: src/snapshot/serialize.cc

Issue 1675553002: [serializer] Ensure immortal immovable roots are deserialized correctly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« src/address-map.cc ('K') | « src/address-map.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serialize.cc
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc
index 096576f0a0e913b7aff318a6bb576bf6e7397779..5ba355470c08c31d248b16431bb64cb2f68f5b92 100644
--- a/src/snapshot/serialize.cc
+++ b/src/snapshot/serialize.cc
@@ -1715,12 +1715,16 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
}
int root_index = root_index_map_.Lookup(obj);
+ bool is_immortal_immovable_root = false;
// We can only encode roots as such if it has already been serialized.
// That applies to root indices below the wave front.
- if (root_index != RootIndexMap::kInvalidRootIndex &&
- root_index < root_index_wave_front_) {
- PutRoot(root_index, obj, how_to_code, where_to_point, skip);
- return;
+ if (root_index != RootIndexMap::kInvalidRootIndex) {
+ if (root_index < root_index_wave_front_) {
+ PutRoot(root_index, obj, how_to_code, where_to_point, skip);
+ return;
+ } else {
+ is_immortal_immovable_root = Heap::RootIsImmortalImmovable(root_index);
+ }
}
if (SerializeKnownObject(obj, how_to_code, where_to_point, skip)) return;
@@ -1731,6 +1735,14 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
ObjectSerializer object_serializer(this, obj, sink_, how_to_code,
where_to_point);
object_serializer.Serialize();
+
+ if (is_immortal_immovable_root) {
+ // Make sure that the immortal immovable root has been included in the first
+ // chunk of its reserved space , so that it is deserialized onto the first
Michael Starzinger 2016/02/05 14:47:59 nit: Spurious white-space before comma.
+ // page of its space and stays immortal immovable.
+ BackReference ref = back_reference_map_.Lookup(obj);
+ CHECK(ref.is_valid() && ref.chunk_index() == 0);
+ }
}
« src/address-map.cc ('K') | « src/address-map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698