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

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

Issue 1216933011: [turbofan] Enable tail calls for %_CallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix platform ports Created 5 years, 6 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/pipeline.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index 50eb64cceddfa826641e69d36600cd757b1daa49..bdce0832011e4ce8a1c21a301c1672535e7f7171 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -538,13 +538,6 @@ void CodeGenerator::AssembleDeconstructActivationRecord() {
if (descriptor->IsJSFunctionCall() || stack_slots > 0) {
__ movq(rsp, rbp);
__ popq(rbp);
- int32_t bytes_to_pop =
- descriptor->IsJSFunctionCall()
- ? static_cast<int32_t>(descriptor->JSParameterCount() *
- kPointerSize)
- : 0;
- __ popq(Operand(rsp, bytes_to_pop));
- __ addq(rsp, Immediate(bytes_to_pop));
}
}
@@ -1578,11 +1571,17 @@ void CodeGenerator::AssembleReturn() {
__ popq(rbp); // Pop caller's frame pointer.
int pop_count = descriptor->IsJSFunctionCall()
? static_cast<int>(descriptor->JSParameterCount())
- : 0;
- __ Ret(pop_count * kPointerSize, rbx);
+ : (info()->IsStub()
+ ? info()->code_stub()->GetStackParameterCount()
+ : 0);
+ if (pop_count == 0) {
+ __ Ret();
+ } else {
+ __ Ret(pop_count * kPointerSize, rbx);
+ }
}
} else {
- __ ret(0);
+ __ Ret();
}
}
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698