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

Unified Diff: src/address-map.cc

Issue 1675553002: [serializer] Ensure immortal immovable roots are deserialized correctly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix 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
« no previous file with comments | « no previous file | src/snapshot/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/address-map.cc
diff --git a/src/address-map.cc b/src/address-map.cc
index 681661af2978bbdcc78754a2f9e5a82e1dc9f46d..86558e094aa2215871486d7e1aa656b3d785d2d2 100644
--- a/src/address-map.cc
+++ b/src/address-map.cc
@@ -17,10 +17,10 @@ RootIndexMap::RootIndexMap(Isolate* isolate) {
for (uint32_t i = 0; i < Heap::kStrongRootListLength; i++) {
Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i);
Object* root = isolate->heap()->root(root_index);
+ if (!root->IsHeapObject()) continue;
// Omit root entries that can be written after initialization. They must
// not be referenced through the root list in the snapshot.
- if (root->IsHeapObject() &&
- isolate->heap()->RootCanBeTreatedAsConstant(root_index)) {
+ if (isolate->heap()->RootCanBeTreatedAsConstant(root_index)) {
HeapObject* heap_object = HeapObject::cast(root);
HashMap::Entry* entry = LookupEntry(map_, heap_object, false);
if (entry != NULL) {
@@ -29,6 +29,11 @@ RootIndexMap::RootIndexMap(Isolate* isolate) {
} else {
SetValue(LookupEntry(map_, heap_object, true), i);
}
+ } else {
+ // Immortal immovable root objects are constant and allocated on the first
+ // page of old space. Non-constant roots cannot be immortal immovable. The
+ // root index map contains all immortal immmovable root objects.
+ CHECK(!Heap::RootIsImmortalImmovable(root_index));
}
}
isolate->set_root_index_map(map_);
« no previous file with comments | « no previous file | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698