- do script calls directly from asmjit without using a lambda wrapper

- do VARF_Native check at compile time when possible
This commit is contained in:
Magnus Norddahl 2018-10-10 22:08:26 +02:00
parent 01825231ec
commit b6bc06e568
2 changed files with 162 additions and 49 deletions

View file

@ -42,14 +42,28 @@ private:
void EmitOpcode();
void EmitPopFrame();
void EmitDoCall(asmjit::X86Gp ptr);
void EmitDoTail(asmjit::X86Gp ptr);
enum class CallType
{
Unknown,
Script,
Native
};
void EmitDoCall(asmjit::X86Gp ptr, CallType calltype);
void EmitScriptCall(asmjit::X86Gp vmfunc, asmjit::X86Gp paramsptr);
void EmitNativeCall(asmjit::X86Gp vmfunc, asmjit::X86Gp paramsptr);
void EmitDoTail(asmjit::X86Gp ptr, CallType calltype);
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);
void LoadReturns(const VMOP *retval, int numret);
void FillReturns(const VMOP *retval, int numret);
void LoadCallResult(const VMOP &opdata, bool addrof);
static int DoCall(VMFunction *call, int b, int c, VMValue *param, VMReturn *returns);
static int DoNativeCall(VMFunction *call, int b, int c, VMValue *param, VMReturn *returns);
template <typename Func>
void EmitComparisonOpcode(Func jmpFunc)