Rename BaseRuntime to PluginRuntime.

This commit is contained in:
2015-02-23 16:40:36 -08:00
parent b8d2be9a0d
commit 2f71cb4cd7
13 changed files with 104 additions and 82 deletions
+13 -13
View File
@@ -169,7 +169,7 @@ GenerateArrayIndirectionVectors(cell_t *arraybase, cell_t dims[], cell_t _dimcou
}
int
GenerateFullArray(BaseRuntime *rt, uint32_t argc, cell_t *argv, int autozero)
GenerateFullArray(PluginRuntime *rt, uint32_t argc, cell_t *argv, int autozero)
{
sp_context_t *ctx = rt->GetBaseContext()->GetCtx();
@@ -272,7 +272,7 @@ GetFunctionName(const sp_plugin_t *plugin, uint32_t offs)
#endif
static int
CompileFromThunk(BaseRuntime *runtime, cell_t pcode_offs, void **addrp, char *pc)
CompileFromThunk(PluginRuntime *runtime, cell_t pcode_offs, void **addrp, char *pc)
{
// If the watchdog timer has declared a timeout, we must process it now,
// and possibly refuse to compile, since otherwise we will compile a
@@ -302,7 +302,7 @@ CompileFromThunk(BaseRuntime *runtime, cell_t pcode_offs, void **addrp, char *pc
return SP_ERROR_NONE;
}
Compiler::Compiler(BaseRuntime *rt, cell_t pcode_offs)
Compiler::Compiler(PluginRuntime *rt, cell_t pcode_offs)
: rt_(rt),
plugin_(rt->plugin()),
error_(SP_ERROR_NONE),
@@ -1927,7 +1927,7 @@ JITX86::ShutdownJIT()
}
CompiledFunction *
JITX86::CompileFunction(BaseRuntime *prt, cell_t pcode_offs, int *err)
JITX86::CompileFunction(PluginRuntime *prt, cell_t pcode_offs, int *err)
{
Compiler cc(prt, pcode_offs);
CompiledFunction *fun = cc.emit(err);
@@ -1943,7 +1943,7 @@ JITX86::CompileFunction(BaseRuntime *prt, cell_t pcode_offs, int *err)
}
void
JITX86::SetupContextVars(BaseRuntime *runtime, BaseContext *pCtx, sp_context_t *ctx)
JITX86::SetupContextVars(PluginRuntime *runtime, BaseContext *pCtx, sp_context_t *ctx)
{
ctx->tracker = new tracker_t;
ctx->tracker->pBase = (ucell_t *)malloc(1024);
@@ -1993,7 +1993,7 @@ JITX86::StartCompilation()
}
ICompilation *
JITX86::StartCompilation(BaseRuntime *runtime)
JITX86::StartCompilation(PluginRuntime *runtime)
{
return new CompData;
}
@@ -2030,7 +2030,7 @@ CompData::SetOption(const char *key, const char *val)
}
int
JITX86::InvokeFunction(BaseRuntime *runtime, CompiledFunction *fn, cell_t *result)
JITX86::InvokeFunction(PluginRuntime *runtime, CompiledFunction *fn, cell_t *result)
{
sp_context_t *ctx = runtime->GetBaseContext()->GetCtx();
@@ -2061,14 +2061,14 @@ JITX86::FreeCode(void *code)
}
void
JITX86::RegisterRuntime(BaseRuntime *rt)
JITX86::RegisterRuntime(PluginRuntime *rt)
{
mutex_.AssertCurrentThreadOwns();
runtimes_.append(rt);
}
void
JITX86::DeregisterRuntime(BaseRuntime *rt)
JITX86::DeregisterRuntime(PluginRuntime *rt)
{
mutex_.AssertCurrentThreadOwns();
runtimes_.remove(rt);
@@ -2078,8 +2078,8 @@ void
JITX86::PatchAllJumpsForTimeout()
{
mutex_.AssertCurrentThreadOwns();
for (ke::InlineList<BaseRuntime>::iterator iter = runtimes_.begin(); iter != runtimes_.end(); iter++) {
BaseRuntime *rt = *iter;
for (ke::InlineList<PluginRuntime>::iterator iter = runtimes_.begin(); iter != runtimes_.end(); iter++) {
PluginRuntime *rt = *iter;
for (size_t i = 0; i < rt->NumJitFunctions(); i++) {
CompiledFunction *fun = rt->GetJitFunction(i);
uint8_t *base = reinterpret_cast<uint8_t *>(fun->GetEntryAddress());
@@ -2097,8 +2097,8 @@ void
JITX86::UnpatchAllJumpsFromTimeout()
{
mutex_.AssertCurrentThreadOwns();
for (ke::InlineList<BaseRuntime>::iterator iter = runtimes_.begin(); iter != runtimes_.end(); iter++) {
BaseRuntime *rt = *iter;
for (ke::InlineList<PluginRuntime>::iterator iter = runtimes_.begin(); iter != runtimes_.end(); iter++) {
PluginRuntime *rt = *iter;
for (size_t i = 0; i < rt->NumJitFunctions(); i++) {
CompiledFunction *fun = rt->GetJitFunction(i);
uint8_t *base = reinterpret_cast<uint8_t *>(fun->GetEntryAddress());
+9 -9
View File
@@ -85,7 +85,7 @@ public:
class Compiler
{
public:
Compiler(BaseRuntime *rt, cell_t pcode_offs);
Compiler(PluginRuntime *rt, cell_t pcode_offs);
~Compiler();
CompiledFunction *emit(int *errp);
@@ -122,7 +122,7 @@ class Compiler
private:
AssemblerX86 masm;
BaseRuntime *rt_;
PluginRuntime *rt_;
const sp_plugin_t *plugin_;
int error_;
uint32_t pcode_start_;
@@ -154,18 +154,18 @@ class JITX86
public:
bool InitializeJIT();
void ShutdownJIT();
ICompilation *StartCompilation(BaseRuntime *runtime);
ICompilation *StartCompilation(PluginRuntime *runtime);
ICompilation *StartCompilation();
void SetupContextVars(BaseRuntime *runtime, BaseContext *pCtx, sp_context_t *ctx);
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(BaseRuntime *runtime, cell_t pcode_offs, int *err);
CompiledFunction *CompileFunction(PluginRuntime *runtime, cell_t pcode_offs, int *err);
ICompilation *ApplyOptions(ICompilation *_IN, ICompilation *_OUT);
int InvokeFunction(BaseRuntime *runtime, CompiledFunction *fn, cell_t *result);
int InvokeFunction(PluginRuntime *runtime, CompiledFunction *fn, cell_t *result);
void RegisterRuntime(BaseRuntime *rt);
void DeregisterRuntime(BaseRuntime *rt);
void RegisterRuntime(PluginRuntime *rt);
void DeregisterRuntime(PluginRuntime *rt);
void PatchAllJumpsForTimeout();
void UnpatchAllJumpsFromTimeout();
@@ -190,7 +190,7 @@ class JITX86
void *m_pJitEntry; /* Entry function */
void *m_pJitReturn; /* Universal return address */
void *m_pJitTimeout; /* Universal timeout address */
ke::InlineList<BaseRuntime> runtimes_;
ke::InlineList<PluginRuntime> runtimes_;
uintptr_t frame_id_;
uintptr_t level_;
ke::Mutex mutex_;