Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: src/x64/code-stubs-x64.cc

Issue 697603002: Optimized nodeType dom binding by removing HandleScope and the preparation of ordinary c function c… (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698