Commit f7b61ca6 authored by machenbach's avatar machenbach Committed by Commit bot

Revert of PPC/s390: [ignition] Add call bytecodes for undefined receiver...

Revert of PPC/s390: [ignition] Add call bytecodes for undefined receiver (patchset #1 id:1 of https://codereview.chromium.org/2809743003/ )

Reason for revert:
Need to revert:
https://chromium-review.googlesource.com/c/463287/

Original issue's description:
> PPC/s390: [ignition] Add call bytecodes for undefined receiver
>
> Port 751e8935
>
> Original Commit Message:
>
>     Adds a collection of call bytecodes which have an implicit undefined
>     receiver argument, for cases such as global calls where we know that the
>     receiver has to be undefined. This way we can skip an LdaUndefined,
>     decrease bytecode register pressure, and set a more accurate
>     ConvertReceiverMode on the interpreter and TurboFan call.
>
>     As a side effect, the "normal" Call bytecode now becomes a rare case
>     (only with calls and super property calls), so we get rid of its 0-2
>     argument special cases and modify CallProperty[N] to use the
>     NotNullOrUndefined ConvertReceiverMode.
>
> R=leszeks@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
> BUG=
> LOG=N
>
> Review-Url: https://codereview.chromium.org/2809743003
> Cr-Commit-Position: refs/heads/master@{#44539}
> Committed: https://chromium.googlesource.com/v8/v8/+/41b228057f89e73fbaae867177d523e60d4e92bc

TBR=joransiu@ca.ibm.com,jyan@ca.ibm.com,leszeks@chromium.org,michael_dawson@ca.ibm.com,bjaideep@ca.ibm.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2809093002
Cr-Commit-Position: refs/heads/master@{#44546}
parent 7a8d20a7
......@@ -1097,7 +1097,11 @@ static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args,
static void Generate_InterpreterPushArgs(MacroAssembler* masm,
Register num_args, Register index,
Register count, Register scratch) {
Register count, Register scratch,
Label* stack_overflow) {
// A stack check before pushing arguments.
Generate_StackOverflowCheck(masm, num_args, scratch, stack_overflow);
Label loop;
__ addi(index, index, Operand(kPointerSize)); // Bias up for LoadPU
__ mtctr(count);
......@@ -1109,8 +1113,8 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm,
// static
void Builtins::Generate_InterpreterPushArgsThenCallImpl(
MacroAssembler* masm, ConvertReceiverMode receiver_mode,
TailCallMode tail_call_mode, InterpreterPushArgsMode mode) {
MacroAssembler* masm, TailCallMode tail_call_mode,
InterpreterPushArgsMode mode) {
// ----------- S t a t e -------------
// -- r3 : the number of arguments (not including the receiver)
// -- r5 : the address of the first argument to be pushed. Subsequent
......@@ -1123,16 +1127,8 @@ void Builtins::Generate_InterpreterPushArgsThenCallImpl(
// Calculate number of arguments (add one for receiver).
__ addi(r6, r3, Operand(1));
Generate_StackOverflowCheck(masm, r6, ip, &stack_overflow);
// Push "undefined" as the receiver arg if we need to.
if (receiver_mode == ConvertReceiverMode::kNullOrUndefined) {
__ PushRoot(Heap::kUndefinedValueRootIndex);
__ mr(r6, r3); // Argument count is correct.
}
// Push the arguments. r5, r6, r7 will be modified.
Generate_InterpreterPushArgs(masm, r6, r5, r6, r7);
Generate_InterpreterPushArgs(masm, r6, r5, r6, r7, &stack_overflow);
// Call the target.
if (mode == InterpreterPushArgsMode::kJSFunction) {
......@@ -1176,9 +1172,8 @@ void Builtins::Generate_InterpreterPushArgsThenConstructImpl(
Label skip;
__ cmpi(r3, Operand::Zero());
__ beq(&skip);
Generate_StackOverflowCheck(masm, r3, ip, &stack_overflow);
// Push the arguments. r8, r7, r9 will be modified.
Generate_InterpreterPushArgs(masm, r3, r7, r3, r9);
Generate_InterpreterPushArgs(masm, r3, r7, r3, r8, &stack_overflow);
__ bind(&skip);
__ AssertUndefinedOrAllocationSite(r5, r8);
......@@ -1221,14 +1216,10 @@ void Builtins::Generate_InterpreterPushArgsThenConstructArray(
// -----------------------------------
Label stack_overflow;
// Push a slot for the receiver to be constructed.
__ li(r0, Operand::Zero());
__ push(r0);
Generate_StackOverflowCheck(masm, r3, ip, &stack_overflow);
__ addi(r7, r3, Operand(1)); // Add one for receiver.
// Push the arguments. r6, r8, r3 will be modified.
Generate_InterpreterPushArgs(masm, r3, r6, r3, r8);
Generate_InterpreterPushArgs(masm, r7, r6, r7, r8, &stack_overflow);
// Array constructor expects constructor in r6. It is same as r4 here.
__ mr(r6, r4);
......
......@@ -1101,7 +1101,11 @@ static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args,
static void Generate_InterpreterPushArgs(MacroAssembler* masm,
Register num_args, Register index,
Register count, Register scratch) {
Register count, Register scratch,
Label* stack_overflow) {
// Add a stack check before pushing arguments.
Generate_StackOverflowCheck(masm, num_args, scratch, stack_overflow);
Label loop;
__ AddP(index, index, Operand(kPointerSize)); // Bias up for LoadPU
__ LoadRR(r0, count);
......@@ -1115,8 +1119,8 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm,
// static
void Builtins::Generate_InterpreterPushArgsThenCallImpl(
MacroAssembler* masm, ConvertReceiverMode receiver_mode,
TailCallMode tail_call_mode, InterpreterPushArgsMode mode) {
MacroAssembler* masm, TailCallMode tail_call_mode,
InterpreterPushArgsMode mode) {
// ----------- S t a t e -------------
// -- r2 : the number of arguments (not including the receiver)
// -- r4 : the address of the first argument to be pushed. Subsequent
......@@ -1128,16 +1132,9 @@ void Builtins::Generate_InterpreterPushArgsThenCallImpl(
// Calculate number of arguments (AddP one for receiver).
__ AddP(r5, r2, Operand(1));
Generate_StackOverflowCheck(masm, r5, ip, &stack_overflow);
// Push "undefined" as the receiver arg if we need to.
if (receiver_mode == ConvertReceiverMode::kNullOrUndefined) {
__ PushRoot(Heap::kUndefinedValueRootIndex);
__ LoadRR(r5, r2); // Argument count is correct.
}
// Push the arguments.
Generate_InterpreterPushArgs(masm, r5, r4, r5, r6);
Generate_InterpreterPushArgs(masm, r5, r4, r5, r6, &stack_overflow);
// Call the target.
if (mode == InterpreterPushArgsMode::kJSFunction) {
......@@ -1181,8 +1178,7 @@ void Builtins::Generate_InterpreterPushArgsThenConstructImpl(
Label skip;
__ CmpP(r2, Operand::Zero());
__ beq(&skip);
Generate_StackOverflowCheck(masm, r2, ip, &stack_overflow);
Generate_InterpreterPushArgs(masm, r2, r6, r2, r7);
Generate_InterpreterPushArgs(masm, r2, r6, r2, r7, &stack_overflow);
__ bind(&skip);
__ AssertUndefinedOrAllocationSite(r4, r7);
......@@ -1225,14 +1221,10 @@ void Builtins::Generate_InterpreterPushArgsThenConstructArray(
// -----------------------------------
Label stack_overflow;
// Push a slot for the receiver to be constructed.
__ LoadImmP(r0, Operand::Zero());
__ push(r0);
Generate_StackOverflowCheck(masm, r2, ip, &stack_overflow);
__ AddP(r6, r2, Operand(1)); // Add one for receiver.
// Push the arguments. r6, r8, r3 will be modified.
Generate_InterpreterPushArgs(masm, r6, r5, r2, r7);
Generate_InterpreterPushArgs(masm, r6, r5, r6, r7, &stack_overflow);
// Array constructor expects constructor in r5. It is same as r3 here.
__ LoadRR(r5, r3);
......
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