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

Unified Diff: src/heap/heap.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/heap/heap.h ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 16b5deccf6ebf97253d04db7e49c8a40f2285ac8..8bd250406b4b2380336ae9f726175c64b4a3f3dc 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3148,30 +3148,33 @@ void Heap::CreateInitialObjects() {
bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) {
- RootListIndex writable_roots[] = {
- kStoreBufferTopRootIndex,
- kStackLimitRootIndex,
- kNumberStringCacheRootIndex,
- kInstanceofCacheFunctionRootIndex,
- kInstanceofCacheMapRootIndex,
- kInstanceofCacheAnswerRootIndex,
- kCodeStubsRootIndex,
- kNonMonomorphicCacheRootIndex,
- kPolymorphicCodeCacheRootIndex,
- kLastScriptIdRootIndex,
- kEmptyScriptRootIndex,
- kRealStackLimitRootIndex,
- kArgumentsAdaptorDeoptPCOffsetRootIndex,
- kConstructStubDeoptPCOffsetRootIndex,
- kGetterStubDeoptPCOffsetRootIndex,
- kSetterStubDeoptPCOffsetRootIndex,
- kStringTableRootIndex,
- };
+ switch (root_index) {
+ case kStoreBufferTopRootIndex:
+ case kNumberStringCacheRootIndex:
+ case kInstanceofCacheFunctionRootIndex:
+ case kInstanceofCacheMapRootIndex:
+ case kInstanceofCacheAnswerRootIndex:
+ case kCodeStubsRootIndex:
+ case kNonMonomorphicCacheRootIndex:
+ case kPolymorphicCodeCacheRootIndex:
+ case kEmptyScriptRootIndex:
+ case kSymbolRegistryRootIndex:
+ case kMaterializedObjectsRootIndex:
+ case kAllocationSitesScratchpadRootIndex:
+ case kMicrotaskQueueRootIndex:
+ case kDetachedContextsRootIndex:
+ case kWeakObjectToCodeTableRootIndex:
+// Smi values
+#define SMI_ENTRY(type, name, Name) case k##Name##RootIndex:
+ SMI_ROOT_LIST(SMI_ENTRY)
+#undef SMI_ENTRY
+ // String table
+ case kStringTableRootIndex:
+ return true;
- for (unsigned int i = 0; i < arraysize(writable_roots); i++) {
- if (root_index == writable_roots[i]) return true;
+ default:
+ return false;
}
- return false;
}
« no previous file with comments | « src/heap/heap.h ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698