Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index 4bb0b4d1b7d7e446bc1435cf4b919bc108d8da06..d29d6123da8ea6767a0b7a89f2c2a34876dba8c3 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -4,8 +4,8 @@ |
#include "src/full-codegen/full-codegen.h" |
-#include "src/ast/ast.h" |
#include "src/ast/ast-numbering.h" |
+#include "src/ast/ast.h" |
#include "src/ast/prettyprinter.h" |
#include "src/ast/scopeinfo.h" |
#include "src/ast/scopes.h" |
@@ -14,6 +14,7 @@ |
#include "src/compiler.h" |
#include "src/debug/debug.h" |
#include "src/debug/liveedit.h" |
+#include "src/frames-inl.h" |
#include "src/isolate-inl.h" |
#include "src/macro-assembler.h" |
#include "src/snapshot/snapshot.h" |
@@ -559,6 +560,11 @@ void FullCodeGenerator::EmitIntrinsicAsStubCall(CallRuntime* expr, |
} |
} |
__ Call(callable.code(), RelocInfo::CODE_TARGET); |
+ |
+ // Reload the context register after the call as i.e. TurboFan code stubs |
+ // won't preserve the context register. |
+ LoadFromFrameField(StandardFrameConstants::kContextOffset, |
+ context_register()); |
context()->Plug(result_register()); |
} |
@@ -1269,6 +1275,11 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
decrement_loop_depth(); |
} |
+void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
+ LoadFromFrameField(JavaScriptFrameConstants::kFunctionOffset, |
+ result_register()); |
+ context()->Plug(result_register()); |
+} |
void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { |
Comment cmnt(masm_, "[ TryCatchStatement"); |