* src/vm/jit/inline/inline.c (relocate_stack_ptr_inter, rewrite_method):
authoredwin <none@none>
Wed, 22 Mar 2006 01:22:11 +0000 (01:22 +0000)
committeredwin <none@none>
Wed, 22 Mar 2006 01:22:11 +0000 (01:22 +0000)
Fixed warnings.

* src/vm/jit/inline/inline_debug.c (DEBUG_SLOT, dump_inline_tree):
Fixed warnings.

src/vm/jit/inline/inline.c
src/vm/jit/inline/inline_debug.c

index a1758cb71ae07c0e4bff362539fc97590d970c66..fa11affa2321b01c5d1c8bc63056ea39e4f6117c 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: inline.c 4662 2006-03-21 00:13:45Z edwin $
+   $Id: inline.c 4670 2006-03-22 01:22:11Z edwin $
 
 */
 
@@ -342,7 +342,7 @@ static stackptr relocate_stack_ptr_intern(inline_node *iln,stackptr o_link,ptrin
                else {
                        /* this stack slot it in the most recent chunk */
                        assert(curreloc);
-                       DOLOG( printf("\t\t\toffset %d\n",curreloc) );
+                       DOLOG( printf("\t\t\toffset %d\n",(int)curreloc) );
                        return (stackptr) ((u1*)o_link + curreloc);
                }
        }
@@ -740,6 +740,7 @@ static void rewrite_method(inline_node *iln)
 
        assert(iln);
 
+       n_bptr = NULL;
        nextcall = iln->children;
 
        /* set memory cursors */
@@ -753,10 +754,10 @@ static void rewrite_method(inline_node *iln)
 
                if (o_bptr->flags < BBREACHED) {
                        DOLOG(
-                       printf("skipping old L%03d (flags=%d,type=%d,os=%p,oid=%d,ois=%p,cursor=%d,curreloc=%d,callerstack=%d) of ",
+                       printf("skipping old L%03d (flags=%d,type=%d,os=%p,oid=%d,ois=%p,cursor=%d,callerstack=%d) of ",
                                        o_bptr->debug_nr,o_bptr->flags,o_bptr->type,
                                        (void*)o_bptr->stack,o_bptr->indepth,(void*)o_bptr->instack,
-                                       DEBUG_SLOT(iln->n_inlined_stack_cursor),curreloc,
+                                       DEBUG_SLOT(iln->n_inlined_stack_cursor),
                                        DEBUG_SLOT(iln->n_callerstack));
                        method_println(iln->m);
                        );
@@ -777,10 +778,10 @@ static void rewrite_method(inline_node *iln)
                o_iptr = o_bptr->iinstr;
 
                DOLOG(
-               printf("rewriting old L%03d (flags=%d,type=%d,os=%p,oid=%d,ois=%p,cursor=%d,curreloc=%d,callerstack=%d) of ",
+               printf("rewriting old L%03d (flags=%d,type=%d,os=%p,oid=%d,ois=%p,cursor=%d,callerstack=%d) of ",
                                o_bptr->debug_nr,o_bptr->flags,o_bptr->type,
                                (void*)o_bptr->stack,o_bptr->indepth,(void*)o_bptr->instack,
-                               DEBUG_SLOT(iln->n_inlined_stack_cursor),curreloc,
+                               DEBUG_SLOT(iln->n_inlined_stack_cursor),
                                DEBUG_SLOT(iln->n_callerstack));
                method_println(iln->m);
                printf("o_instack: ");debug_dump_stack(o_bptr->instack);printf("\n");
@@ -813,7 +814,7 @@ static void rewrite_method(inline_node *iln)
 
                /* calculate the stack element relocation */
                curreloc = (u1*)iln->n_inlined_stack_cursor - (u1*)o_bptr->stack;
-               DOLOG( printf("curreloc <- %d = %p - %p\n",curreloc,(void*)iln->n_inlined_stack_cursor,(void*)(u1*)o_bptr->stack) );
+               DOLOG( printf("curreloc <- %d = %p - %p\n",(int)curreloc,(void*)iln->n_inlined_stack_cursor,(void*)(u1*)o_bptr->stack) );
 
                o_nexttorewrite = o_bptr->stack;
                o_lasttorewrite = o_bptr->stack-1;
@@ -923,7 +924,7 @@ static void rewrite_method(inline_node *iln)
                                printf("resuming old L%03d (flags=%d,type=%d,os=%p,oid=%d,ois=%p,cursor=%d,curreloc=%d,callerstack=%d) of ",
                                                o_bptr->debug_nr,o_bptr->flags,o_bptr->type,
                                                (void*)o_bptr->stack,o_bptr->indepth,(void*)o_bptr->instack,
-                                               DEBUG_SLOT(iln->n_inlined_stack_cursor),curreloc,
+                                               DEBUG_SLOT(iln->n_inlined_stack_cursor),(int)curreloc,
                                                DEBUG_SLOT(iln->n_callerstack));
                                method_println(iln->m);
                                );
@@ -972,7 +973,7 @@ static void rewrite_method(inline_node *iln)
        }
 
        /* end of basic blocks */
-       if (!iln->depth) {
+       if (!iln->depth && n_bptr) {
                n_bptr->next = NULL;
        }
 
index d6322e8ca4b549e7b8a1d10b642ed81ed9293377..2fe90f23755f4d6ad9e403d5777c2ff228e859bd 100644 (file)
@@ -1,6 +1,6 @@
 #include <ctype.h>
 
-#define DEBUG_SLOT(slot)  ((slot) ? ((slot) - iln->ctx->n_debug_stackbase) : (-1))
+#define DEBUG_SLOT(slot)  ((int)((slot) ? ((slot) - iln->ctx->n_debug_stackbase) : (-1)))
 
 #if 0
                printf("linenumbertable_entry %p: pc=%p line=%08x, lntsize=%d, looking for pc=%p\n",
@@ -82,7 +82,7 @@ static void dump_inline_tree(inline_node *iln)
                else {
                        printf("%s[%d] L%03d %d-%d (ins %d,st %d) (sd=%d,cs=%p,lofs=%d) cum(ins %d,st %d,bb %d) ",
                                        indent,iln->depth,iln->callerblock->debug_nr,
-                                       iln->callerpc,iln->callerblock->iinstr - iln->parent->m->basicblocks->iinstr,
+                                       iln->callerpc,(int)(iln->callerblock->iinstr - iln->parent->m->basicblocks->iinstr),
                                        iln->instructioncount,iln->stackcount,iln->n_callerstackdepth,
                                        (void*)iln->n_callerstack,
                                        iln->localsoffset,