From: Aleksey Demakov Date: Sun, 5 Oct 2008 15:34:14 +0000 (+0000) Subject: fix JIT_OP_TRUNC_INT, JIT_OP_TRUNC_UINT, JIT_OP_INCOMING_REG opcodes in interpreter X-Git-Tag: before.move.to.git~57 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=0eb91c3127e43b1ed887efbbc6eafc4c687e2f4b;p=francis%2Flibjit.git fix JIT_OP_TRUNC_INT, JIT_OP_TRUNC_UINT, JIT_OP_INCOMING_REG opcodes in interpreter --- diff --git a/ChangeLog b/ChangeLog index 9ed8920..687a02a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-05 Aleksey Demakov + + * jit/jit-interp.c (_jit_run_function): fix implementation of the + JIT_OP_TRUNC_INT and JIT_OP_TRUNC_UINT opcodes in interpreter. + + * jit/jit-rules-interp.c (_jit_gen_insn): add support of the + JIT_OP_INCOMING_REG opcode, interpreter needs it for exception + handling. + 2008-08-07 Klaus Treichel * jit/jit-apply.c jit/jit-insn.c, jit/jit-interp.c, diff --git a/jit/jit-interp.c b/jit/jit-interp.c index 4a7c8ad..8e208a2 100644 --- a/jit/jit-interp.c +++ b/jit/jit-interp.c @@ -404,7 +404,7 @@ restart_tail: VMCASE(JIT_OP_TRUNC_INT): { /* Truncate an integer to a signed 32-bit value */ - /* In the interpreter, this is a NOP */ + VM_R0_INT = VM_R1_INT; VM_MODIFY_PC(1); } VMBREAK; @@ -412,7 +412,7 @@ restart_tail: VMCASE(JIT_OP_TRUNC_UINT): { /* Truncate an integer to an unsigned 32-bit value */ - /* In the interpreter, this is a NOP */ + VM_R0_INT = VM_R1_INT; VM_MODIFY_PC(1); } VMBREAK; diff --git a/jit/jit-rules-interp.c b/jit/jit-rules-interp.c index cd4a615..683f579 100644 --- a/jit/jit-rules-interp.c +++ b/jit/jit-rules-interp.c @@ -1336,6 +1336,12 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func, jit_cache_opcode(&(gen->posn), insn->opcode); break; + case JIT_OP_INCOMING_REG: + /* Store incoming value (in interpreter this is used to + pass an exception object to the catcher) */ + store_value(gen, insn->value1); + break; + case JIT_OP_RETURN_REG: /* Push a function return value back onto the stack */ switch(jit_type_normalize(insn->value1->type)->kind)