Commit 1542e46d authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [api] Expose FunctionCallbackInfo::NewTarget.

  port 306c412c (r35833)

  original commit message:
  This is needed by Blink to implement the Custom Elements spec.

BUG=

Review-Url: https://codereview.chromium.org/1928213002
Cr-Commit-Position: refs/heads/master@{#35889}
parent ad32faee
......@@ -186,16 +186,9 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ j(greater_equal, &loop);
// Call the function.
if (is_api_function) {
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
Handle<Code> code =
masm->isolate()->builtins()->HandleApiCallConstruct();
__ call(code, RelocInfo::CODE_TARGET);
} else {
ParameterCount actual(eax);
__ InvokeFunction(edi, edx, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
}
// Store offset of return address for deoptimizer.
if (create_implicit_receiver && !is_api_function) {
......
......@@ -5361,9 +5361,14 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
STATIC_ASSERT(FCA::kIsolateIndex == 1);
STATIC_ASSERT(FCA::kHolderIndex == 0);
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 7);
STATIC_ASSERT(FCA::kArgsLength == 8);
__ pop(return_address);
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// context save.
__ push(context);
......@@ -5408,7 +5413,7 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// Allocate the v8::Arguments structure in the arguments' space since
// it's not controlled by GC.
const int kApiStackSpace = 4;
const int kApiStackSpace = 3;
PrepareCallApiFunction(masm, kApiArgc + kApiStackSpace);
......@@ -5419,8 +5424,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
__ mov(ApiParameterOperand(3), scratch);
// FunctionCallbackInfo::length_.
__ Move(ApiParameterOperand(4), Immediate(argc()));
// FunctionCallbackInfo::is_construct_call_.
__ Move(ApiParameterOperand(5), Immediate(0));
// v8::InvocationCallback's argument.
__ lea(scratch, ApiParameterOperand(2));
......@@ -5440,8 +5443,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
}
Operand return_value_operand(ebp, return_value_offset * kPointerSize);
int stack_space = 0;
Operand is_construct_call_operand = ApiParameterOperand(5);
Operand* stack_space_operand = &is_construct_call_operand;
Operand length_operand = ApiParameterOperand(4);
Operand* stack_space_operand = &length_operand;
stack_space = argc() + FCA::kArgsLength + 1;
stack_space_operand = nullptr;
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
......
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