Skip to content

Commit 4f75124

Browse files
bjaideepCommit bot
authored andcommitted
PPC: [api] Expose FunctionCallbackInfo::NewTarget
Port 306c412 Original commit message: This is needed by Blink to implement the Custom Elements spec. [email protected], [email protected], [email protected], [email protected], [email protected] BUG=v8:4261 LOG=N Review-Url: https://codereview.chromium.org/1929703002 Cr-Commit-Position: refs/heads/master@{#35838}
1 parent ff956f4 commit 4f75124

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

src/ppc/builtins-ppc.cc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -605,15 +605,10 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
605605
// r3: number of arguments
606606
// r4: constructor function
607607
// r6: new target
608-
if (is_api_function) {
609-
__ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
610-
Handle<Code> code = masm->isolate()->builtins()->HandleApiCallConstruct();
611-
__ Call(code, RelocInfo::CODE_TARGET);
612-
} else {
613-
ParameterCount actual(r3);
614-
__ InvokeFunction(r4, r6, actual, CALL_FUNCTION,
615-
CheckDebugStepCallWrapper());
616-
}
608+
609+
ParameterCount actual(r3);
610+
__ InvokeFunction(r4, r6, actual, CALL_FUNCTION,
611+
CheckDebugStepCallWrapper());
617612

618613
// Store offset of return address for deoptimizer.
619614
if (create_implicit_receiver && !is_api_function) {

src/ppc/code-stubs-ppc.cc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5635,7 +5635,11 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
56355635
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
56365636
STATIC_ASSERT(FCA::kIsolateIndex == 1);
56375637
STATIC_ASSERT(FCA::kHolderIndex == 0);
5638-
STATIC_ASSERT(FCA::kArgsLength == 7);
5638+
STATIC_ASSERT(FCA::kNewTargetIndex == 7);
5639+
STATIC_ASSERT(FCA::kArgsLength == 8);
5640+
5641+
// new target
5642+
__ PushRoot(Heap::kUndefinedValueRootIndex);
56395643

56405644
// context save
56415645
__ push(context);
@@ -5671,10 +5675,10 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
56715675
// it's not controlled by GC.
56725676
// PPC LINUX ABI:
56735677
//
5674-
// Create 5 extra slots on stack:
5678+
// Create 4 extra slots on stack:
56755679
// [0] space for DirectCEntryStub's LR save
5676-
// [1-4] FunctionCallbackInfo
5677-
const int kApiStackSpace = 5;
5680+
// [1-3] FunctionCallbackInfo
5681+
const int kApiStackSpace = 4;
56785682
const int kFunctionCallbackInfoOffset =
56795683
(kStackFrameExtraParamSlot + 1) * kPointerSize;
56805684

@@ -5693,9 +5697,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
56935697
// FunctionCallbackInfo::length_ = argc
56945698
__ li(ip, Operand(argc()));
56955699
__ stw(ip, MemOperand(r3, 2 * kPointerSize));
5696-
// FunctionCallbackInfo::is_construct_call_ = 0
5697-
__ li(ip, Operand::Zero());
5698-
__ stw(ip, MemOperand(r3, 2 * kPointerSize + kIntSize));
56995700

57005701
ExternalReference thunk_ref =
57015702
ExternalReference::invoke_function_callback(masm->isolate());
@@ -5712,9 +5713,9 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
57125713
}
57135714
MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
57145715
int stack_space = 0;
5715-
MemOperand is_construct_call_operand =
5716-
MemOperand(sp, kFunctionCallbackInfoOffset + 2 * kPointerSize + kIntSize);
5717-
MemOperand* stack_space_operand = &is_construct_call_operand;
5716+
MemOperand length_operand =
5717+
MemOperand(sp, kFunctionCallbackInfoOffset + 2 * kPointerSize);
5718+
MemOperand* stack_space_operand = &length_operand;
57185719
stack_space = argc() + FCA::kArgsLength + 1;
57195720
stack_space_operand = NULL;
57205721
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,

0 commit comments

Comments
 (0)