Commit c94a3d44 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [es6] [interpreter] Add tail calls support to Ignition.

Port 32b4bc13

Original commit message:
    This CL introduces two new bytecodes TailCall and TailCallWide.

R=ishell@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4698,v8:4687
LOG=N

Review URL: https://codereview.chromium.org/1705913002

Cr-Commit-Position: refs/heads/master@{#34096}
parent 8934994e
...@@ -1090,7 +1090,8 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index, ...@@ -1090,7 +1090,8 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index,
// static // static
void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { void Builtins::Generate_InterpreterPushArgsAndCallImpl(
MacroAssembler* masm, TailCallMode tail_call_mode) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r3 : the number of arguments (not including the receiver) // -- r3 : the number of arguments (not including the receiver)
// -- r5 : the address of the first argument to be pushed. Subsequent // -- r5 : the address of the first argument to be pushed. Subsequent
...@@ -1106,7 +1107,9 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { ...@@ -1106,7 +1107,9 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
Generate_InterpreterPushArgs(masm, r5, r6, r7); Generate_InterpreterPushArgs(masm, r5, r6, r7);
// Call the target. // Call the target.
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny,
tail_call_mode),
RelocInfo::CODE_TARGET);
} }
...@@ -2105,6 +2108,16 @@ void PrepareForTailCall(MacroAssembler* masm, Register args_reg, ...@@ -2105,6 +2108,16 @@ void PrepareForTailCall(MacroAssembler* masm, Register args_reg,
__ cmpi(scratch1, Operand::Zero()); __ cmpi(scratch1, Operand::Zero());
__ bne(&done); __ bne(&done);
// Drop possible interpreter handler/stub frame.
{
Label no_interpreter_frame;
__ LoadP(scratch3, MemOperand(fp, StandardFrameConstants::kMarkerOffset));
__ CmpSmiLiteral(scratch3, Smi::FromInt(StackFrame::STUB), r0);
__ bne(&no_interpreter_frame);
__ LoadP(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ bind(&no_interpreter_frame);
}
// Check if next frame is an arguments adaptor frame. // Check if next frame is an arguments adaptor frame.
Label no_arguments_adaptor, formal_parameter_count_loaded; Label no_arguments_adaptor, formal_parameter_count_loaded;
__ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); __ LoadP(scratch2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment