Skip to content

Commit 38e7d1f

Browse files
jyanCommit bot
authored andcommitted
S390: [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/1925233002 Cr-Commit-Position: refs/heads/master@{#35878}
1 parent a5c6676 commit 38e7d1f

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

src/s390/builtins-s390.cc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,10 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
596596
// r2: number of arguments
597597
// r3: constructor function
598598
// r5: new target
599-
if (is_api_function) {
600-
__ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset));
601-
Handle<Code> code = masm->isolate()->builtins()->HandleApiCallConstruct();
602-
__ Call(code, RelocInfo::CODE_TARGET);
603-
} else {
604-
ParameterCount actual(r2);
605-
__ InvokeFunction(r3, r5, actual, CALL_FUNCTION,
606-
CheckDebugStepCallWrapper());
607-
}
599+
600+
ParameterCount actual(r2);
601+
__ InvokeFunction(r3, r5, actual, CALL_FUNCTION,
602+
CheckDebugStepCallWrapper());
608603

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

src/s390/code-stubs-s390.cc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5546,7 +5546,11 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
55465546
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
55475547
STATIC_ASSERT(FCA::kIsolateIndex == 1);
55485548
STATIC_ASSERT(FCA::kHolderIndex == 0);
5549-
STATIC_ASSERT(FCA::kArgsLength == 7);
5549+
STATIC_ASSERT(FCA::kNewTargetIndex == 7);
5550+
STATIC_ASSERT(FCA::kArgsLength == 8);
5551+
5552+
// new target
5553+
__ PushRoot(Heap::kUndefinedValueRootIndex);
55505554

55515555
// context save
55525556
__ push(context);
@@ -5582,10 +5586,10 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
55825586
// it's not controlled by GC.
55835587
// S390 LINUX ABI:
55845588
//
5585-
// Create 5 extra slots on stack:
5589+
// Create 4 extra slots on stack:
55865590
// [0] space for DirectCEntryStub's LR save
5587-
// [1-4] FunctionCallbackInfo
5588-
const int kApiStackSpace = 5;
5591+
// [1-3] FunctionCallbackInfo
5592+
const int kApiStackSpace = 4;
55895593
const int kFunctionCallbackInfoOffset =
55905594
(kStackFrameExtraParamSlot + 1) * kPointerSize;
55915595

@@ -5604,9 +5608,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
56045608
// FunctionCallbackInfo::length_ = argc
56055609
__ LoadImmP(ip, Operand(argc()));
56065610
__ StoreW(ip, MemOperand(r2, 2 * kPointerSize));
5607-
// FunctionCallbackInfo::is_construct_call_ = 0
5608-
__ LoadImmP(ip, Operand::Zero());
5609-
__ StoreW(ip, MemOperand(r2, 2 * kPointerSize + kIntSize));
56105611

56115612
ExternalReference thunk_ref =
56125613
ExternalReference::invoke_function_callback(masm->isolate());
@@ -5623,9 +5624,9 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
56235624
}
56245625
MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
56255626
int stack_space = 0;
5626-
MemOperand is_construct_call_operand =
5627-
MemOperand(sp, kFunctionCallbackInfoOffset + 2 * kPointerSize + kIntSize);
5628-
MemOperand* stack_space_operand = &is_construct_call_operand;
5627+
MemOperand length_operand =
5628+
MemOperand(sp, kFunctionCallbackInfoOffset + 2 * kPointerSize);
5629+
MemOperand* stack_space_operand = &length_operand;
56295630
stack_space = argc() + FCA::kArgsLength + 1;
56305631
stack_space_operand = NULL;
56315632
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,

0 commit comments

Comments
 (0)