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

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

Issue 1439613003: [turbofan] Better and more sane support for tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip test in ignition configuration 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 13ee9d0b35058637d40cfe56305a27bf0bee92d9..117e8cafd0b2d1dcbfbbcdd90617e7d64a6999e2 100644
--- a/src/compiler/mips64/code-generator-mips64.cc
+++ b/src/compiler/mips64/code-generator-mips64.cc
@@ -446,11 +446,21 @@ FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
} while (0)
-void CodeGenerator::AssembleDeconstructActivationRecord() {
+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) {
- __ LeaveFrame(StackFrame::MANUAL);
+ __ mov(sp, fp);
+ __ ld(fp, MemOperand(sp, 0 * kPointerSize));
+ __ ld(ra, MemOperand(sp, 1 * kPointerSize));
+ stack_pointer_delta = 2 * kPointerSize;
+ }
+ if (stack_param_delta < 0) {
+ stack_pointer_delta += -stack_param_delta * kPointerSize;
+ }
+ if (stack_pointer_delta != 0) {
+ __ daddiu(sp, sp, stack_pointer_delta);
}
}
@@ -474,7 +484,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break;
}
case kArchTailCallCodeObject: {
- AssembleDeconstructActivationRecord();
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1);
+ AssembleDeconstructActivationRecord(stack_param_delta);
if (instr->InputAt(0)->IsImmediate()) {
__ Jump(Handle<Code>::cast(i.InputHeapObject(0)),
RelocInfo::CODE_TARGET);
@@ -504,7 +515,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
__ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg));
}
- AssembleDeconstructActivationRecord();
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1);
+ AssembleDeconstructActivationRecord(stack_param_delta);
__ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(at);
break;
« 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