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_); |