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
// -- 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;
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);
__ mov(scratch, esp);
// push return address
- __ push(context);
+ __ push(return_address);
// load context from callee
__ mov(context, FieldOperand(callee, JSFunction::kContextOffset));
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);
}
void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {
esi, // context
- eax, // callee
+ edi, // callee
ebx, // call_data
ecx, // holder
edx, // api_function_address
- edi, // actual number of arguments
+ eax, // actual number of arguments
};
Representation representations[] = {
Representation::Tagged(), // context
void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {
esi, // context
- eax, // callee
+ edi, // callee
ebx, // call_data
ecx, // holder
edx, // api_function_address