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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 1848553002: [full-codegen] Reload context register after intrinsic call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing include Created 4 years, 9 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/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698