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

Unified Diff: src/serialize.cc

Issue 979003003: Only reference constant root list entries in the snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 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 | « src/ppc/macro-assembler-ppc.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 0b39d25642a324f68ca766fc2223a98c2bc2e4ba..d9c94e9dd776a813313388c95069d49434c18121 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -481,8 +481,12 @@ RootIndexMap::RootIndexMap(Isolate* isolate) {
map_ = new HashMap(HashMap::PointersMatch);
Object** root_array = isolate->heap()->roots_array_start();
for (uint32_t i = 0; i < Heap::kStrongRootListLength; i++) {
- Object* root = root_array[i];
- if (root->IsHeapObject() && !isolate->heap()->InNewSpace(root)) {
+ Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i);
+ Object* root = root_array[root_index];
+ // 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)) {
HeapObject* heap_object = HeapObject::cast(root);
HashMap::Entry* entry = LookupEntry(map_, heap_object, false);
if (entry != NULL) {
« no previous file with comments | « src/ppc/macro-assembler-ppc.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698