| Index: src/x64/code-stubs-x64.cc
|
| diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
|
| index 01bddaf970fc5ea384a5b444d60f05188eac06ae..10c482085723c0fc48362d922a5a2a1bd2ff8065 100644
|
| --- a/src/x64/code-stubs-x64.cc
|
| +++ b/src/x64/code-stubs-x64.cc
|
| @@ -4709,6 +4709,60 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| +void CallFastApiGetterStub::Generate(MacroAssembler* masm) {
|
| + // ----------- S t a t e -------------
|
| + // -- rsp[0] : return address
|
| + // -- rsp[8] : name
|
| + // -- rsp[16 - kArgsLength*8] : PropertyCallbackArguments object
|
| + // -- ...
|
| + // -- r8 : api_function_address
|
| + // -----------------------------------
|
| +
|
| +#if defined(__MINGW64__) || defined(_WIN64)
|
| + Register getter_arg = r8;
|
| + Register accessor_info_arg = rdx;
|
| + Register name_arg = rcx;
|
| +#else
|
| + Register getter_arg = rdx;
|
| + Register accessor_info_arg = rsi;
|
| + Register name_arg = rdi;
|
| +#endif
|
| + Register api_function_address = ApiGetterDescriptor::function_address();
|
| + DCHECK(api_function_address.is(r8));
|
| +
|
| + // for retq to restore the esp
|
| + // The esp offset = sizeof(PropertyCallbackInfo)
|
| + // + addrOf(PropertyCallbackInfo)
|
| + // + addrOf(name)
|
| + const int kStackSpace = PropertyCallbackInfo<Value>::kArgsLength + 2;
|
| +
|
| + __ Store(ExternalReference(Isolate::kContextAddress, isolate()), rsi);
|
| +
|
| + __ leap(name_arg, StackSpaceOperand(1));
|
| + __ leap(accessor_info_arg, StackSpaceOperand(2));
|
| +
|
| +
|
| +
|
| + ExternalReference thunk_ref =
|
| + ExternalReference::invoke_accessor_getter_callback(isolate());
|
| +
|
| + // It's okay if api_function_address == getter_arg
|
| + // but not accessor_info_arg or name_arg
|
| + DCHECK(!api_function_address.is(accessor_info_arg) &&
|
| + !api_function_address.is(name_arg));
|
| +
|
| + // The name handler is counted as an argument.
|
| + StackArgumentsAccessor args(rbp, PropertyCallbackInfo<Value>::kArgsLength);
|
| + Operand return_value_operand(
|
| + StackSpaceOperand(3 + PropertyCallbackArguments::kReturnValueOffset));
|
| + __ CallFastApiFunctionAndReturn(api_function_address,
|
| + thunk_ref,
|
| + getter_arg,
|
| + kStackSpace,
|
| + return_value_operand,
|
| + NULL);
|
| +}
|
| +
|
| #undef __
|
|
|
| } } // namespace v8::internal
|
|
|