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

Unified Diff: src/compiler/mips/code-generator-mips.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/linkage.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips/code-generator-mips.cc
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc
index 54bb55a146085cfca2baaecc3d1007aff64add97..efdeb6415dfa2bffeaa845ccb0f78e31d02f8282 100644
--- a/src/compiler/mips/code-generator-mips.cc
+++ b/src/compiler/mips/code-generator-mips.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);
+ __ lw(fp, MemOperand(sp, 0 * kPointerSize));
+ __ lw(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) {
+ __ addiu(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);
@@ -506,7 +517,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg));
}
- AssembleDeconstructActivationRecord();
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1);
+ AssembleDeconstructActivationRecord(stack_param_delta);
__ lw(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
__ Jump(at);
break;
« no previous file with comments | « src/compiler/linkage.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698