]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
fix JIT_OP_TRUNC_INT, JIT_OP_TRUNC_UINT, JIT_OP_INCOMING_REG opcodes in interpreter
authorAleksey Demakov <ademakov@gmail.com>
Sun, 5 Oct 2008 15:34:14 +0000 (15:34 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Sun, 5 Oct 2008 15:34:14 +0000 (15:34 +0000)
ChangeLog
jit/jit-interp.c
jit/jit-rules-interp.c

index 9ed8920bcd3f0958aec7e117380e4829b7768c83..687a02a311047f07aa017210c6a4751c5501753d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-05  Aleksey Demakov  <ademakov@gmail.com>
+
+       * 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  <ktreichel@web.de>
 
        * jit/jit-apply.c jit/jit-insn.c, jit/jit-interp.c,
index 4a7c8adcc073f000e5b73bc103781f00c87e3c92..8e208a24578e5a3d6c296af84961147ad4b03f9a 100644 (file)
@@ -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;
index cd4a615d43b8a04f42d730af0014fb705b215507..683f579534feacee34b108d1090f9a460fcd1378 100644 (file)
@@ -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)