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

Unified Diff: src/ia32/code-stubs-ia32.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 | « no previous file | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 130311e7e18e0fbcdc63e492addff218b2cde72c..f92ee549c60bd57ec9da054f20ba6a4ded2412a8 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -4876,12 +4876,12 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
bool return_first_arg,
bool call_data_undefined) {
// ----------- S t a t e -------------
- // -- eax : callee
+ // -- edi : callee
// -- ebx : call_data
// -- ecx : holder
// -- edx : api_function_address
// -- esi : context
- // -- edi : number of arguments if argc is a register
+ // -- eax : number of arguments if argc is a register
// --
// -- esp[0] : return address
// -- esp[4] : last argument
@@ -4890,11 +4890,12 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
// -- esp[(argc + 1) * 4] : receiver
// -----------------------------------
- Register callee = eax;
+ Register callee = edi;
Register call_data = ebx;
Register holder = ecx;
Register api_function_address = edx;
Register context = esi;
+ Register return_address = eax;
typedef FunctionCallbackArguments FCA;
@@ -4907,10 +4908,17 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
STATIC_ASSERT(FCA::kHolderIndex == 0);
STATIC_ASSERT(FCA::kArgsLength == 7);
- DCHECK(argc.is_immediate() || edi.is(argc.reg()));
+ DCHECK(argc.is_immediate() || eax.is(argc.reg()));
- // pop return address and save context
- __ xchg(context, Operand(esp, 0));
+ if (argc.is_immediate()) {
+ __ pop(return_address);
+ // context save.
+ __ push(context);
+ } else {
+ // pop return address and save context
+ __ xchg(context, Operand(esp, 0));
+ return_address = context;
+ }
// callee
__ push(callee);
@@ -4938,7 +4946,7 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
__ mov(scratch, esp);
// push return address
- __ push(context);
+ __ push(return_address);
// load context from callee
__ mov(context, FieldOperand(callee, JSFunction::kContextOffset));
@@ -5011,9 +5019,8 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm,
void CallApiFunctionStub::Generate(MacroAssembler* masm) {
- // TODO(dcarney): make eax contain the function address.
bool call_data_undefined = this->call_data_undefined();
- CallApiFunctionStubHelper(masm, ParameterCount(edi), false,
+ CallApiFunctionStubHelper(masm, ParameterCount(eax), false,
call_data_undefined);
}
« no previous file with comments | « no previous file | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698