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

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

Issue 1088913002: [turbofan] Load immortal heap objects from the heap roots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/compiler/code-generator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('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 cb2e4c8e42f49e04da1577761b642d13c17ffe55..49441e8f748277403ad9beddb3feaa65fa8d7d31 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -184,6 +184,36 @@ void CodeGenerator::RecordSafepoint(ReferenceMap* references,
}
+bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
+ int* offset_return) {
+ if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
+ if (object.is_identical_to(info()->context())) {
+ *offset_return = StandardFrameConstants::kContextOffset;
+ return true;
+ } else if (object.is_identical_to(info()->closure())) {
+ *offset_return = JavaScriptFrameConstants::kFunctionOffset;
+ return true;
+ }
+ }
+ return false;
+}
+
+
+bool CodeGenerator::IsMaterializableFromRoot(
+ Handle<HeapObject> object, Heap::RootListIndex* index_return) {
+ if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
+#define IMMORTAL_IMMOVABLE_ROOT(Name) \
+ if (*object == isolate()->heap()->root(Heap::k##Name##RootIndex)) { \
+ *index_return = Heap::k##Name##RootIndex; \
+ return true; \
+ }
+ IMMORTAL_IMMOVABLE_ROOT_LIST(IMMORTAL_IMMOVABLE_ROOT)
+#undef IMMORTAL_IMMOVABLE_ROOT
+ }
+ return false;
+}
+
+
void CodeGenerator::AssembleInstruction(Instruction* instr) {
AssembleGaps(instr);
AssembleSourcePosition(instr);
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698