Remove the JITX86 class.
This commit is contained in:
parent
111dd7eb68
commit
781c5129a9
@ -568,7 +568,7 @@ BaseContext::Execute2(IPluginFunction *function, const cell_t *params, unsigned
|
|||||||
if (fn) {
|
if (fn) {
|
||||||
m_pRuntime->m_PubJitFuncs[public_id] = fn;
|
m_pRuntime->m_PubJitFuncs[public_id] = fn;
|
||||||
} else {
|
} else {
|
||||||
if ((fn = g_Jit.CompileFunction(m_pRuntime, cfun->Public()->code_offs, &ir)) == NULL)
|
if ((fn = CompileFunction(m_pRuntime, cfun->Public()->code_offs, &ir)) == NULL)
|
||||||
return ir;
|
return ir;
|
||||||
m_pRuntime->m_PubJitFuncs[public_id] = fn;
|
m_pRuntime->m_PubJitFuncs[public_id] = fn;
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,6 @@ using namespace sp;
|
|||||||
|
|
||||||
#define __ masm.
|
#define __ masm.
|
||||||
|
|
||||||
JITX86 g_Jit;
|
|
||||||
|
|
||||||
static inline ConditionCode
|
static inline ConditionCode
|
||||||
OpToCondition(OPCODE op)
|
OpToCondition(OPCODE op)
|
||||||
{
|
{
|
||||||
@ -255,6 +253,22 @@ GetFunctionName(const sp_plugin_t *plugin, uint32_t offs)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CompiledFunction *
|
||||||
|
CompileFunction(PluginRuntime *prt, cell_t pcode_offs, int *err)
|
||||||
|
{
|
||||||
|
Compiler cc(prt, pcode_offs);
|
||||||
|
CompiledFunction *fun = cc.emit(err);
|
||||||
|
if (!fun)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Grab the lock before linking code in, since the watchdog timer will look
|
||||||
|
// at this list on another thread.
|
||||||
|
ke::AutoLock lock(Environment::get()->lock());
|
||||||
|
|
||||||
|
prt->AddJittedFunction(fun);
|
||||||
|
return fun;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
CompileFromThunk(PluginRuntime *runtime, cell_t pcode_offs, void **addrp, char *pc)
|
CompileFromThunk(PluginRuntime *runtime, cell_t pcode_offs, void **addrp, char *pc)
|
||||||
{
|
{
|
||||||
@ -267,7 +281,7 @@ CompileFromThunk(PluginRuntime *runtime, cell_t pcode_offs, void **addrp, char *
|
|||||||
CompiledFunction *fn = runtime->GetJittedFunctionByOffset(pcode_offs);
|
CompiledFunction *fn = runtime->GetJittedFunctionByOffset(pcode_offs);
|
||||||
if (!fn) {
|
if (!fn) {
|
||||||
int err;
|
int err;
|
||||||
fn = g_Jit.CompileFunction(runtime, pcode_offs, &err);
|
fn = CompileFunction(runtime, pcode_offs, &err);
|
||||||
if (!fn)
|
if (!fn)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -1789,23 +1803,3 @@ Compiler::emitErrorPaths()
|
|||||||
__ jmp(ExternalAddress(env_->stubs()->ReturnStub()));
|
__ jmp(ExternalAddress(env_->stubs()->ReturnStub()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JITX86::JITX86()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CompiledFunction *
|
|
||||||
JITX86::CompileFunction(PluginRuntime *prt, cell_t pcode_offs, int *err)
|
|
||||||
{
|
|
||||||
Compiler cc(prt, pcode_offs);
|
|
||||||
CompiledFunction *fun = cc.emit(err);
|
|
||||||
if (!fun)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// Grab the lock before linking code in, since the watchdog timer will look
|
|
||||||
// at this list on another thread.
|
|
||||||
ke::AutoLock lock(Environment::get()->lock());
|
|
||||||
|
|
||||||
prt->AddJittedFunction(fun);
|
|
||||||
return fun;
|
|
||||||
}
|
|
||||||
|
@ -130,15 +130,6 @@ class Compiler
|
|||||||
ke::Vector<CallThunk *> thunks_; //:TODO: free
|
ke::Vector<CallThunk *> thunks_; //:TODO: free
|
||||||
};
|
};
|
||||||
|
|
||||||
class JITX86
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
JITX86();
|
|
||||||
|
|
||||||
public:
|
|
||||||
CompiledFunction *CompileFunction(PluginRuntime *runtime, cell_t pcode_offs, int *err);
|
|
||||||
};
|
|
||||||
|
|
||||||
const Register pri = eax;
|
const Register pri = eax;
|
||||||
const Register alt = edx;
|
const Register alt = edx;
|
||||||
const Register stk = edi;
|
const Register stk = edi;
|
||||||
@ -146,7 +137,8 @@ const Register dat = esi;
|
|||||||
const Register tmp = ecx;
|
const Register tmp = ecx;
|
||||||
const Register frm = ebx;
|
const Register frm = ebx;
|
||||||
|
|
||||||
extern JITX86 g_Jit;
|
CompiledFunction *
|
||||||
|
CompileFunction(PluginRuntime *prt, cell_t pcode_offs, int *err);
|
||||||
|
|
||||||
#endif //_INCLUDE_SOURCEPAWN_JIT_X86_H_
|
#endif //_INCLUDE_SOURCEPAWN_JIT_X86_H_
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user