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

Unified Diff: src/compiler/linkage-impl.h

Issue 892593002: [turbofan] Fix usage of ThisFunction parameter in OSR. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/linkage.cc ('k') | src/compiler/mips/linkage-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage-impl.h
diff --git a/src/compiler/linkage-impl.h b/src/compiler/linkage-impl.h
index c24ae8873c74746198f177bc40679d1d75cfeb6d..b270664c7fb43cf9ca5b8c61f8792e74fa60b4de 100644
--- a/src/compiler/linkage-impl.h
+++ b/src/compiler/linkage-impl.h
@@ -29,7 +29,8 @@ class LinkageHelper {
}
// TODO(turbofan): cache call descriptors for JSFunction calls.
- static CallDescriptor* GetJSCallDescriptor(Zone* zone, int js_parameter_count,
+ static CallDescriptor* GetJSCallDescriptor(Zone* zone, bool is_osr,
+ int js_parameter_count,
CallDescriptor::Flags flags) {
const size_t return_count = 1;
const size_t context_count = 1;
@@ -56,7 +57,12 @@ class LinkageHelper {
// The target for JS function calls is the JSFunction object.
MachineType target_type = kMachAnyTagged;
- LinkageLocation target_loc = regloc(LinkageTraits::JSCallFunctionReg());
+ // Unoptimized code doesn't preserve the JSCallFunctionReg, so expect the
+ // closure on the stack.
+ LinkageLocation target_loc =
+ is_osr ? stackloc(Linkage::kJSFunctionCallClosureParamIndex -
+ js_parameter_count)
+ : regloc(LinkageTraits::JSCallFunctionReg());
return new (zone) CallDescriptor( // --
CallDescriptor::kCallJSFunction, // kind
target_type, // target MachineType
« no previous file with comments | « src/compiler/linkage.cc ('k') | src/compiler/mips/linkage-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698