Commit 57733bdd authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [builtins] Always pass target and new target to C++ builtins

Port f5b83dec

Original commit message:

    As a first step towards showing builtin frames in stack traces, we will now
    push target and new target unconditionally.

    Since the various specializations of BuiltinArguments are made redundant by
    this change, we can remove them and all related code.

R=jgruber@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2079073003
Cr-Commit-Position: refs/heads/master@{#37075}
parent c4d2b191
......@@ -17,8 +17,7 @@ namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
BuiltinExtraArguments extra_args) {
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
// ----------- S t a t e -------------
// -- r3 : number of arguments excluding receiver
// -- r4 : target
......@@ -37,24 +36,8 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
__ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
// Insert extra arguments.
int num_extra_args = 0;
switch (extra_args) {
case BuiltinExtraArguments::kTarget:
__ Push(r4);
++num_extra_args;
break;
case BuiltinExtraArguments::kNewTarget:
__ Push(r6);
++num_extra_args;
break;
case BuiltinExtraArguments::kTargetAndNewTarget:
const int num_extra_args = 2;
__ Push(r4, r6);
num_extra_args += 2;
break;
case BuiltinExtraArguments::kNone:
break;
}
// JumpToExternalReference expects r3 to contain the number of arguments
// including the receiver and the extra arguments.
__ addi(r3, r3, Operand(num_extra_args + 1));
......
......@@ -15,8 +15,7 @@ namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
BuiltinExtraArguments extra_args) {
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
// ----------- S t a t e -------------
// -- r2 : number of arguments excluding receiver
// -- r3 : target
......@@ -35,24 +34,8 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
__ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset));
// Insert extra arguments.
int num_extra_args = 0;
switch (extra_args) {
case BuiltinExtraArguments::kTarget:
__ Push(r3);
++num_extra_args;
break;
case BuiltinExtraArguments::kNewTarget:
__ Push(r5);
++num_extra_args;
break;
case BuiltinExtraArguments::kTargetAndNewTarget:
const int num_extra_args = 2;
__ Push(r3, r5);
num_extra_args += 2;
break;
case BuiltinExtraArguments::kNone:
break;
}
// JumpToExternalReference expects r2 to contain the number of arguments
// including the receiver and the extra arguments.
__ AddP(r2, r2, Operand(num_extra_args + 1));
......
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