made these names a little nicer

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40140
This commit is contained in:
David Anderson
2006-11-04 18:54:03 +00:00
parent 0ece7914b7
commit 8099cb09bd
5 changed files with 26 additions and 135 deletions
+10 -10
View File
@@ -1712,7 +1712,7 @@ cell_t NativeCallback_Debug(sp_context_t *ctx, ucell_t native_idx, cell_t *param
cell_t save_sp = ctx->sp;
cell_t save_hp = ctx->hp;
if (ctx->hp < ctx->heapbase)
if (ctx->hp < ctx->heap_base)
{
ctx->err = SP_ERROR_HEAPMIN;
return 0;
@@ -1724,7 +1724,7 @@ cell_t NativeCallback_Debug(sp_context_t *ctx, ucell_t native_idx, cell_t *param
return 0;
}
if ((uint32_t)ctx->sp >= ctx->memory)
if ((uint32_t)ctx->sp >= ctx->mem_size)
{
ctx->err = SP_ERROR_STACKMIN;
return 0;
@@ -1936,12 +1936,12 @@ jit_rewind:
ctx->flags = (data->debug ? SPFLAG_PLUGIN_DEBUG : 0);
/* setup memory */
ctx->data = new uint8_t[plugin->memory];
memcpy(ctx->data, plugin->data, plugin->data_size);
ctx->memory = plugin->memory;
ctx->heapbase = plugin->data_size;
ctx->hp = ctx->heapbase;
ctx->sp = ctx->memory - sizeof(cell_t);
ctx->memory = new uint8_t[plugin->memory];
memcpy(ctx->memory, plugin->data, plugin->data_size);
ctx->mem_size = plugin->memory;
ctx->heap_base = plugin->data_size;
ctx->hp = ctx->heap_base;
ctx->sp = ctx->mem_size - sizeof(cell_t);
const char *strbase = plugin->info.stringbase;
uint32_t max, iter;
@@ -1960,7 +1960,7 @@ jit_rewind:
/* relocate pubvar info */
if ((max = plugin->info.pubvars_num))
{
uint8_t *dat = ctx->data;
uint8_t *dat = ctx->memory;
ctx->pubvars = new sp_pubvar_t[max];
for (iter=0; iter<max; iter++)
{
@@ -2065,7 +2065,7 @@ int JITX86::ContextExecute(sp_context_t *ctx, uint32_t code_idx, cell_t *result)
void JITX86::FreeContext(sp_context_t *ctx)
{
engine->ExecFree(ctx->codebase);
delete [] ctx->data;
delete [] ctx->memory;
delete [] ctx->files;
delete [] ctx->lines;
delete [] ctx->natives;
+1 -1
View File
@@ -52,7 +52,7 @@ jitoffs_t Write_Execute_Function(JitWriter *jit)
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, REG_EAX, AMX_INFO_CONTEXT);
IA32_Mov_Reg_Rm_Disp8(jit, REG_ECX, REG_EAX, offsetof(sp_context_t, hp));
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, REG_ECX, AMX_INFO_HEAP);
IA32_Mov_Reg_Rm_Disp8(jit, AMX_REG_DAT, REG_EAX, offsetof(sp_context_t, data));
IA32_Mov_Reg_Rm_Disp8(jit, AMX_REG_DAT, REG_EAX, offsetof(sp_context_t, memory));
/* Frame setup */
//mov edi, [eax+<offs>] - get stack pointer