- remove the need to do any VARF_Native runtime checks by making native functions use the same calling convention as the script version

This commit is contained in:
Magnus Norddahl 2018-10-10 23:47:56 +02:00
parent b6bc06e568
commit 0120ea190c
8 changed files with 68 additions and 157 deletions

View file

@ -42,20 +42,11 @@ private:
void EmitOpcode();
void EmitPopFrame();
enum class CallType
{
Unknown,
Script,
Native
};
void EmitDoCall(asmjit::X86Gp ptr, CallType calltype);
void EmitDoCall(asmjit::X86Gp ptr);
void EmitScriptCall(asmjit::X86Gp vmfunc, asmjit::X86Gp paramsptr);
void EmitNativeCall(asmjit::X86Gp vmfunc, asmjit::X86Gp paramsptr);
void EmitDoTail(asmjit::X86Gp ptr, CallType calltype);
void EmitDoTail(asmjit::X86Gp ptr);
void EmitScriptTailCall(asmjit::X86Gp vmfunc, asmjit::X86Gp result, asmjit::X86Gp paramsptr);
void EmitNativeTailCall(asmjit::X86Gp vmfunc, asmjit::X86Gp result, asmjit::X86Gp paramsptr);
void StoreInOuts(int b);
void LoadInOuts(int b);
@ -63,8 +54,6 @@ private:
void FillReturns(const VMOP *retval, int numret);
void LoadCallResult(const VMOP &opdata, bool addrof);
static int DoNativeCall(VMFunction *call, int b, int c, VMValue *param, VMReturn *returns);
template <typename Func>
void EmitComparisonOpcode(Func jmpFunc)
{