]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
At the end of initialize setjmp block add a label that is moved along with
authorAleksey Demakov <ademakov@gmail.com>
Sun, 28 May 2006 11:11:57 +0000 (11:11 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Sun, 28 May 2006 11:11:57 +0000 (11:11 +0000)
the block code and use it as the jump target.

ChangeLog
jit/jit-insn.c

index e0267438d1bb3dc175f6fdaed32e67c925835c73..760f54d845bc4e083e826f41beeec8ab71c70b91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-28  Klaus Treichel  <ktreichel@web.de>
+
+       * jit/jit-insn.c: Add a code_label in initialize_setjmp_block just
+       before the end_label that is moved with the block to the start of
+       the function as jump target to the code. Otherwise other blocks
+       moved to the start after this block will never be executed.
+
 2006-05-27  Aleksey Demakov  <ademakov@gmail.com>
 
        * jit/jit-reg-alloc.c (free_value, save_value): the value that has
index e3fc3a4bc753522b875ccb10ad6f11dc8a8178fb..9e6d42f71a501700302b5a3b3dfab26eb6a3dc0f 100644 (file)
@@ -7000,6 +7000,7 @@ static int initialize_setjmp_block(jit_function_t func)
 #if !defined(JIT_BACKEND_INTERP)
        jit_label_t start_label = jit_label_undefined;
        jit_label_t end_label = jit_label_undefined;
+       jit_label_t code_label = jit_label_undefined;
        jit_label_t rethrow_label = jit_label_undefined;
        jit_type_t type;
        jit_value_t args[2];
@@ -7105,7 +7106,7 @@ static int initialize_setjmp_block(jit_function_t func)
 #endif /* !HAVE_SIGSETJMP */
 
        /* Branch to the end of the init code if "setjmp" returned zero */
-       if(!jit_insn_branch_if_not(func, value, &end_label))
+       if(!jit_insn_branch_if_not(func, value, &code_label))
        {
                return 0;
        }
@@ -7176,6 +7177,12 @@ static int initialize_setjmp_block(jit_function_t func)
                 JIT_CALL_NOTHROW | JIT_CALL_NORETURN);
        jit_type_free(type);
 
+       /* Insert the target to jump to the normal code. */
+       if(!jit_insn_label(func, &code_label))
+       {
+               return 0;
+       }
+
        /* Force the start of a new block to mark the end of the init code */
        if(!jit_insn_label(func, &end_label))
        {