diff --git a/sourcepawn/jit/sp_vm_basecontext.cpp b/sourcepawn/jit/sp_vm_basecontext.cpp index c96e7c1a..7f460a64 100644 --- a/sourcepawn/jit/sp_vm_basecontext.cpp +++ b/sourcepawn/jit/sp_vm_basecontext.cpp @@ -58,12 +58,18 @@ BaseContext::BaseContext(PluginRuntime *pRuntime) m_ctx.n_idx = SP_ERROR_NONE; m_ctx.rp = 0; - g_Jit.SetupContextVars(m_pRuntime, this, &m_ctx); + m_ctx.tracker = new tracker_t; + m_ctx.tracker->pBase = (ucell_t *)malloc(1024); + m_ctx.tracker->pCur = m_ctx.tracker->pBase; + m_ctx.tracker->size = 1024 / sizeof(cell_t); + m_ctx.basecx = this; + m_ctx.plugin = const_cast(pRuntime->plugin()); } BaseContext::~BaseContext() { - g_Jit.FreeContextVars(&m_ctx); + free(m_ctx.tracker->pBase); + delete m_ctx.tracker; } IVirtualMachine * diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index 9c362e9a..0f0be507 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -1934,17 +1934,6 @@ JITX86::CompileFunction(PluginRuntime *prt, cell_t pcode_offs, int *err) return fun; } -void -JITX86::SetupContextVars(PluginRuntime *runtime, BaseContext *pCtx, sp_context_t *ctx) -{ - ctx->tracker = new tracker_t; - ctx->tracker->pBase = (ucell_t *)malloc(1024); - ctx->tracker->pCur = ctx->tracker->pBase; - ctx->tracker->size = 1024 / sizeof(cell_t); - ctx->basecx = pCtx; - ctx->plugin = const_cast(runtime->plugin()); -} - SPVM_NATIVE_FUNC JITX86::CreateFakeNative(SPVM_FAKENATIVE_FUNC callback, void *pData) { @@ -1996,13 +1985,6 @@ CompData::Abort() delete this; } -void -JITX86::FreeContextVars(sp_context_t *ctx) -{ - free(ctx->tracker->pBase); - delete ctx->tracker; -} - bool CompData::SetOption(const char *key, const char *val) { diff --git a/sourcepawn/jit/x86/jit_x86.h b/sourcepawn/jit/x86/jit_x86.h index e48d8de7..7bb5bb0e 100644 --- a/sourcepawn/jit/x86/jit_x86.h +++ b/sourcepawn/jit/x86/jit_x86.h @@ -154,8 +154,6 @@ class JITX86 void ShutdownJIT(); ICompilation *StartCompilation(PluginRuntime *runtime); ICompilation *StartCompilation(); - void SetupContextVars(PluginRuntime *runtime, BaseContext *pCtx, sp_context_t *ctx); - void FreeContextVars(sp_context_t *ctx); SPVM_NATIVE_FUNC CreateFakeNative(SPVM_FAKENATIVE_FUNC callback, void *pData); void DestroyFakeNative(SPVM_NATIVE_FUNC func); CompiledFunction *CompileFunction(PluginRuntime *runtime, cell_t pcode_offs, int *err);