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

Unified Diff: src/compiler/mips64/code-generator-mips64.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/mips/code-generator-mips.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips64/code-generator-mips64.cc
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc
index 6591fbfc9bb821d81aab2e71e81afad00b45fef2..f4f8d4309119c974f7e682a33ef073903c518086 100644
--- a/src/compiler/mips64/code-generator-mips64.cc
+++ b/src/compiler/mips64/code-generator-mips64.cc
@@ -454,20 +454,23 @@ FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) {
- CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
- int stack_slots = frame()->GetSpillSlotCount();
- int stack_pointer_delta = 0;
- if (descriptor->IsJSFunctionCall() || stack_slots > 0) {
- __ mov(sp, fp);
- __ ld(fp, MemOperand(sp, 0 * kPointerSize));
- __ ld(ra, MemOperand(sp, 1 * kPointerSize));
- stack_pointer_delta = 2 * kPointerSize;
+ int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta);
+ if (sp_slot_delta > 0) {
+ __ daddiu(sp, sp, sp_slot_delta * kPointerSize);
}
- if (stack_param_delta < 0) {
- stack_pointer_delta += -stack_param_delta * kPointerSize;
+ CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
+ int spill_slots = frame()->GetSpillSlotCount();
+ bool has_frame = descriptor->IsJSFunctionCall() || spill_slots > 0;
+ if (has_frame) {
+ __ Pop(ra, fp);
}
- if (stack_pointer_delta != 0) {
- __ daddiu(sp, sp, stack_pointer_delta);
+}
+
+
+void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) {
+ int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta);
+ if (sp_slot_delta < 0) {
+ __ Dsubu(sp, sp, Operand(-sp_slot_delta * kPointerSize));
}
}
@@ -538,6 +541,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ PrepareCallCFunction(num_parameters, kScratchReg);
break;
}
+ case kArchPrepareTailCall:
+ AssemblePrepareTailCall(i.InputInt32(instr->InputCount() - 1));
+ break;
case kArchCallCFunction: {
int const num_parameters = MiscField::decode(instr->opcode());
if (instr->InputAt(0)->IsImmediate()) {
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698