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

Unified Diff: src/compiler/linkage.cc

Issue 1455833004: [turbofan]: Implement tail calls with more callee than caller parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve comment Created 5 years, 1 month 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.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 9f89e3d0ba652c49a796faf6aebac8fdda6e360e..b048019ca385238accaba2a1ce1a00e92b0de3e2 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -91,10 +91,7 @@ bool CallDescriptor::HasSameReturnLocationsAs(
bool CallDescriptor::CanTailCall(const Node* node,
int* stack_param_delta) const {
- // TODO(danno): TF only current supports tail calls where the number of stack
- // parameters of the callee is the same or fewer of the caller.
CallDescriptor const* other = OpParameter<CallDescriptor const*>(node);
- if (!HasSameReturnLocationsAs(other)) return false;
size_t current_input = 0;
size_t other_input = 0;
*stack_param_delta = 0;
@@ -103,14 +100,14 @@ bool CallDescriptor::CanTailCall(const Node* node,
while (more_other || more_this) {
if (other_input < other->InputCount()) {
if (!other->GetInputLocation(other_input).IsRegister()) {
- (*stack_param_delta)++;
+ (*stack_param_delta)--;
}
} else {
more_other = false;
}
if (current_input < InputCount()) {
if (!GetInputLocation(current_input).IsRegister()) {
- (*stack_param_delta)--;
+ (*stack_param_delta)++;
}
} else {
more_this = false;
@@ -118,7 +115,7 @@ bool CallDescriptor::CanTailCall(const Node* node,
++current_input;
++other_input;
}
- return *stack_param_delta <= 0;
+ return HasSameReturnLocationsAs(OpParameter<CallDescriptor const*>(node));
}
« no previous file with comments | « src/compiler/linkage.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698