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

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

Issue 883613003: fix performance regression on intel call api stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/ic/x64/handler-compiler-x64.cc ('k') | src/x64/interface-descriptors-x64.cc » ('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 66dfe1f8e05c111a08887eabe5da20fb7c9526fe..f572ae2477247a0839648230ba4c695662ecd09b 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -4817,12 +4817,12 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
bool return_first_arg,
bool call_data_undefined) {
// ----------- S t a t e -------------
- // -- rax : callee
+ // -- rdi : callee
// -- rbx : call_data
// -- rcx : holder
// -- rdx : api_function_address
// -- rsi : context
- // -- rdi : number of arguments if argc is a register
+ // -- rax : number of arguments if argc is a register
// -- rsp[0] : return address
// -- rsp[8] : last argument
// -- ...
@@ -4830,11 +4830,12 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
// -- rsp[(argc + 1) * 8] : receiver
// -----------------------------------
- Register callee = rax;
+ Register callee = rdi;
Register call_data = rbx;
Register holder = rcx;
Register api_function_address = rdx;
Register context = rsi;
+ Register return_address = r8;
typedef FunctionCallbackArguments FCA;
@@ -4847,17 +4848,12 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
STATIC_ASSERT(FCA::kHolderIndex == 0);
STATIC_ASSERT(FCA::kArgsLength == 7);
- DCHECK(argc.is_immediate() || rdi.is(argc.reg()));
+ DCHECK(argc.is_immediate() || rax.is(argc.reg()));
- if (kPointerSize == kInt64Size) {
- // pop return address and save context
- __ xchgq(context, Operand(rsp, 0));
- } else {
- // x32 handling.
- __ PopReturnAddressTo(kScratchRegister);
- __ Push(context);
- __ movq(context, kScratchRegister);
- }
+ __ PopReturnAddressTo(return_address);
+
+ // context save
+ __ Push(context);
// callee
__ Push(callee);
@@ -4880,7 +4876,7 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
__ movp(scratch, rsp);
// Push return address back on stack.
- __ PushReturnAddressFrom(context);
+ __ PushReturnAddressFrom(return_address);
// load context from callee
__ movp(context, FieldOperand(callee, JSFunction::kContextOffset));
@@ -4954,9 +4950,8 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
void CallApiFunctionStub::Generate(MacroAssembler* masm) {
- // TODO(dcarney): make rax contain the function address.
bool call_data_undefined = this->call_data_undefined();
- CallApiFunctionStubHelper(masm, ParameterCount(rdi), false,
+ CallApiFunctionStubHelper(masm, ParameterCount(rax), false,
call_data_undefined);
}
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698