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

Unified Diff: src/compiler/code-generator.cc

Issue 1178853002: [heap] Unify the immortal immovable root detection mechanism. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use the right predicate during code generation. Created 5 years, 6 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/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 6b9a8b86c6560794e57ab33cf8d4032389f69e0c..2e56dd0a484e00cf091f699e8077dcbf2612b06e 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -220,8 +220,12 @@ bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
bool CodeGenerator::IsMaterializableFromRoot(
Handle<HeapObject> object, Heap::RootListIndex* index_return) {
- if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
- return isolate()->heap()->GetRootListIndex(object, index_return);
+ Heap::RootListIndex index;
+ if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall() &&
+ isolate()->heap()->GetRootListIndex(*object, &index) &&
+ !Heap::RootCanBeWrittenAfterInitialization(index)) {
+ *index_return = index;
+ return true;
}
return false;
}
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698