-ansi -pedantic fixes.
authortwisti <none@none>
Fri, 12 Nov 2004 13:34:26 +0000 (13:34 +0000)
committertwisti <none@none>
Fri, 12 Nov 2004 13:34:26 +0000 (13:34 +0000)
41 files changed:
jit/codegen.inc
jit/codegen.inc.h
jit/inline.c
jit/inline.h
jit/jit.c
jit/jit.h
jit/parse.c
jit/parseRT.c
jit/parseRTstats.c
jit/reg.h
jit/x86_64/codegen.c
jni.c
loader.c
mm/boehm-gc/include/private/gc_locks.h
mm/boehm-gc/include/private/gcconfig.h
nat/JOWENNTest1.c
nat/Runtime.c
src/boehm-gc/include/private/gc_locks.h
src/boehm-gc/include/private/gcconfig.h
src/mm/memory.c
src/mm/memory.h
src/native/jni.c
src/native/vm/VMRuntime.c
src/threads/green/threads.c
src/threads/green/threads.h
src/vm/jit/codegen.inc
src/vm/jit/codegen.inc.h
src/vm/jit/inline/inline.c
src/vm/jit/inline/inline.h
src/vm/jit/inline/parseRT.c
src/vm/jit/inline/parseRTstats.c
src/vm/jit/jit.c
src/vm/jit/jit.h
src/vm/jit/parse.c
src/vm/jit/reg.h
src/vm/jit/x86_64/codegen.c
src/vm/loader.c
threads/thread.c
threads/thread.h
toolbox/memory.c
toolbox/memory.h

index c9c8fcffbf40aa51ff7482416878c415a0c2ab64..d55917b2d926eeceea1022c997021eaeb5196f79 100644 (file)
@@ -48,7 +48,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen.inc 1475 2004-11-11 10:27:49Z twisti $
+   $Id: codegen.inc 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -93,15 +93,15 @@ void codegen_init()
 
                mte = NEW(methodtree_element);
 
-               mte->startpc = asm_calljavafunction;
-               mte->endpc = asm_calljavafunction2 - 1;
+               mte->startpc = (functionptr) asm_calljavafunction;
+               mte->endpc = (functionptr) ((long) asm_calljavafunction2 - 1);
 
                avl_insert(methodtree, mte);
 
                mte = NEW(methodtree_element);
 
-               mte->startpc = asm_calljavafunction2;
-               mte->endpc = asm_call_jit_compiler - 1;
+               mte->startpc = (functionptr) asm_calljavafunction2;
+               mte->endpc = (functionptr) ((long) asm_call_jit_compiler - 1);
 
                avl_insert(methodtree, mte);
        }
@@ -547,11 +547,13 @@ static int methodtree_comparator(const void *pc, const void *element, void *para
        /* compare both startpc and endpc of pc, even if they have the same value,
           otherwise the avl_probe sometimes thinks the element is already in the
           tree */
-       if (mte->startpc <= mtepc->startpc && mtepc->startpc <= mte->endpc &&
-               mte->startpc <= mtepc->endpc   && mtepc->endpc   <= mte->endpc) {
+       if ((long) mte->startpc <= (long) mtepc->startpc &&
+               (long) mtepc->startpc <= (long) mte->endpc &&
+               (long) mte->startpc <= (long) mtepc->endpc &&
+               (long) mtepc->endpc <= (long) mte->endpc) {
                return 0;
 
-       } else if (mtepc->startpc < mte->startpc) {
+       } else if ((long) mtepc->startpc < (long) mte->startpc) {
                return -1;
 
        } else {
@@ -577,7 +579,7 @@ void *codegen_findmethod1(void *pc)
 #endif
 
 
-void codegen_insertmethod(void *startpc, void *endpc)
+void codegen_insertmethod(functionptr startpc, functionptr endpc)
 {
        methodtree_element *mte;
 
@@ -609,7 +611,7 @@ void codegen_insertmethod(void *startpc, void *endpc)
 }
 
 
-void *codegen_findmethod(void *pc)
+functionptr codegen_findmethod(functionptr pc)
 {
        methodtree_element *mtepc;
        methodtree_element *mte;
@@ -652,7 +654,7 @@ void *codegen_findmethod(void *pc)
 static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
 {
        jumpref *jr;
-       u1 *epoint;
+       functionptr epoint;
        s4 extralen;
        s4 alignedlen;
 
@@ -673,17 +675,18 @@ static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
        alignedlen = ALIGN(mcodelen, MAX_ALIGN) + cd->dseglen;
 
        m->mcodelength = mcodelen + cd->dseglen;
-       m->mcode = CNEW(u1, alignedlen + extralen);
+       m->mcode = (functionptr) (long) CNEW(u1, alignedlen + extralen);
 
-       memcpy(m->mcode, cd->dsegtop - cd->dseglen, cd->dseglen);
-       memcpy(m->mcode + cd->dseglen, cd->mcodebase, mcodelen);
+       memcpy((void *) (long) m->mcode, cd->dsegtop - cd->dseglen, cd->dseglen);
+       memcpy((void *) ((long) m->mcode + cd->dseglen), cd->mcodebase, mcodelen);
 
-       m->entrypoint = epoint = (u1 *) (m->mcode + cd->dseglen);
+       m->entrypoint = epoint = (functionptr) ((long) m->mcode + cd->dseglen);
 
        /* jump table resolving */
        jr = cd->jumpreferences;
        while (jr != NULL) {
-               *((void**) (epoint + jr->tablepos)) = epoint + jr->target->mpc;
+               *((functionptr *) ((long) epoint + jr->tablepos)) =
+                       (functionptr) ((long) epoint + (long) jr->target->mpc);
                jr = jr->next;
        }
 
@@ -717,12 +720,14 @@ static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
                dataref *dr;
 
                /* add method into methodtree to find the entrypoint */
-               codegen_insertmethod(m->entrypoint, m->entrypoint + mcodelen);
+               codegen_insertmethod(m->entrypoint,
+                                                        (functionptr) ((long) m->entrypoint + mcodelen));
 
                /* data segment references resolving */
                dr = cd->datareferences;
                while (dr != NULL) {
-                       *((void**) ((long) epoint + (long) dr->pos - POINTERSIZE)) = epoint;
+                       *((functionptr *) ((long) epoint + (long) dr->pos - POINTERSIZE)) =
+                               epoint;
                        dr = dr->next;
                }
        }
@@ -730,14 +735,14 @@ static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
 
 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
        {
-               threadcritnode *n = (threadcritnode *) (m->mcode + alignedlen);
+               threadcritnode *n = (threadcritnode *) ((long) m->mcode + alignedlen);
                s4 i;
                threadcritnodetemp *nt = cd->threadcrit;
 
                for (i = 0; i < cd->threadcritcount; i++) {
-                       n->mcodebegin = m->mcode + nt->mcodebegin;
-                       n->mcodeend = m->mcode + nt->mcodeend;
-                       n->mcoderestart = m->mcode + nt->mcoderestart;
+                       n->mcodebegin = (u1 *) (long) m->mcode + nt->mcodebegin;
+                       n->mcodeend = (u1 *) (long) m->mcode + nt->mcodeend;
+                       n->mcoderestart = (u1 *) (long) m->mcode + nt->mcoderestart;
                        thread_registercritical(n);
                        n++;
                        nt = nt->next;
@@ -752,13 +757,13 @@ void dseg_display(methodinfo *m, codegendata *cd)
        s4 *s4ptr;
        s4 i;
        
-       s4ptr = (s4 *) m->mcode;
+       s4ptr = (s4 *) (long) m->mcode;
 
        printf("  --- dump of datasegment\n");
        for (i = cd->dseglen; i > 0 ; i -= 4) {
                printf("-%6x: %8x\n", i, (s4) (*s4ptr++));
        }
-       printf("  --- begin of data segment: %p\n", s4ptr);
+       printf("  --- begin of data segment: %p\n", (void *) s4ptr);
 }
 
 
index b85f09332a2ab542fec7e4cca2e64f6e97ba3035..b91cd4cee90ae4a6962ff3bf6c826dbd1dd9e717 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: codegen.inc.h 1458 2004-11-05 15:33:49Z twisti $
+   $Id: codegen.inc.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -149,8 +149,8 @@ struct linenumberref {
 typedef struct _methodtree_element methodtree_element;
 
 struct _methodtree_element {
-       void *startpc;
-       void *endpc;
+       functionptr startpc;
+       functionptr endpc;
 };
 #endif
 
@@ -162,7 +162,7 @@ void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *e);
 void codegen(methodinfo *m, codegendata *cd, registerdata *rd);
 void codegen_free(methodinfo *m, codegendata *cd);
 void codegen_close();
-void codegen_insertmethod(void *startpc, void *endpc);
+void codegen_insertmethod(functionptr startpc, functionptr endpc);
 
 #if defined(__I386__) || defined(__X86_64__)
 void codegen_addreference(codegendata *cd, struct basicblock *target, void *branchptr);
index 3ba36d216f8d1b446ab03fa422d5a8b0f329b310..7afd8a6b21f78e8aa69ddd265d1ef517b5c59168 100644 (file)
@@ -28,7 +28,7 @@ globals moved to structure and passed as parameter
 
    Authors: Dieter Thuernbeck
 
-   $Id: inline.c 1474 2004-11-11 10:09:10Z carolyn $
+   $Id: inline.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -58,9 +58,9 @@ globals moved to structure and passed as parameter
   printf("m->maxstack=%i;\n",m->maxstack); fflush(stdout);
 
 bool DEBUGi = false;
-// checked functions and macros: LOADCONST code_get OP1 BUILTIN block_insert bound_check ALIGN
+/* checked functions and macros: LOADCONST code_get OP1 BUILTIN block_insert bound_check ALIGN */
 
-// replace jcodelength loops with correct number after main for loop in parse()!
+/* replace jcodelength loops with correct number after main for loop in parse()! */
 
 
 /*-----------------------------------------------------------*/
@@ -77,7 +77,7 @@ void inlining_init0(methodinfo *m, t_inlining_globals *inline_env)
        inline_env->cummaxstack = m->maxstack; /*why has here been 0 ? */
        inline_env->cumextablelength = 0;
        inline_env->cumlocals = m->maxlocals;
-       inline_env->cummethods = 0;//co not global or static-used only here?
+       inline_env->cummethods = 0; /* co not global or static-used only here? */
        inline_env->inlining_stack = NULL;
        inline_env->inlining_rootinfo = NULL;
 }
@@ -112,11 +112,13 @@ if (DEBUGi==true) {print_t_inlining_globals(inline_env);}
                = inlining_analyse_method(m, 0, 0, 0, 0, inline_env);
 if (DEBUGi==true) {print_t_inlining_globals(inline_env);}
         /*---------------------*/
-       //if (inline_env->cummethods == 0) {
-       //  inline_env = DNEW(t_inlining_globals);
-       //  inlining_init0(m,inline_env);
-       //  return inline_env;
-        //  }
+/*
+ if (inline_env->cummethods == 0) {
+        inline_env = DNEW(t_inlining_globals);
+        inlining_init0(m,inline_env);
+        return inline_env;
+ }
+*/
 if (DEBUGi==true) {
   printf("(l,s) (%i,%i) was (%i,%i)\n",
     m->maxlocals, inline_env->cumlocals,
@@ -334,7 +336,7 @@ inlining_methodinfo *inlining_analyse_method(methodinfo *m,
        bool isnotrootlevel = (level > 0);
        bool isnotleaflevel = (level < INLINING_MAXDEPTH);
 
-       //      if (level == 0) gp = 0;
+       /* if (level == 0) gp = 0; */
        /*
        sprintf (logtext, "Performing inlining analysis of: ");
        utf_sprint (logtext+strlen(logtext), m->class->name);
@@ -344,7 +346,7 @@ inlining_methodinfo *inlining_analyse_method(methodinfo *m,
        dolog (); */
 
        if (isnotrootlevel) {
-               newnode->readonly = readonly = DMNEW(bool, m->maxlocals); //FIXME only paramcount entrys necessary
+               newnode->readonly = readonly = DMNEW(bool, m->maxlocals); /* FIXME only paramcount entrys necessary */
                for (i = 0; i < m->maxlocals; readonly[i++] = true);
                isnotrootlevel = true;
 
@@ -551,7 +553,7 @@ inlining_methodinfo *inlining_analyse_method(methodinfo *m,
                                                (imi->jcodelength < INLINING_MAXCODESIZE) && 
                                                (imi->jcodelength > 0) && 
                                               (((!inlinevirtuals)  || (uniqueVirt)) || (opcode != JAVA_INVOKEVIRTUAL)) &&
-                                               (inlineexceptions || (imi->exceptiontablelength == 0))) { //FIXME: eliminate empty methods?
+                                               (inlineexceptions || (imi->exceptiontablelength == 0))) { /* FIXME: eliminate empty methods? */
                                                inlining_methodinfo *tmp;
                                                descriptor2types(imi);
 
index 84f66c8ad2dbbc2ebb2a8c93ff7a0377fbad3b24..6c40deb6748e3201bf91e03d8e9c619aad90bfd5 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Dieter Thuernbeck
 
-   $Id: inline.h 1456 2004-11-05 14:33:14Z twisti $
+   $Id: inline.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -66,27 +66,27 @@ typedef struct {
 typedef struct {
     listnode linkage;
         
-    // saved static compiler variables
+    /* saved static compiler variables */
         
     methodinfo *method;
         
-    // restored through method
+    /* restored through method */
 
-    // int jcodelength;
-    // u1 *jcode;
-    // classinfo *class;
+    /* int jcodelength; */
+    /* u1 *jcode; */
+       /* classinfo *class; */
 
-    // descriptor never used
-    // maxstack used outside of main for loop
-    // maxlocals never used
+    /* descriptor never used */
+    /* maxstack used outside of main for loop */
+    /* maxlocals never used */
        
-    // exceptiontablelength
-    // raw_extable used outside of main for loop
-    // mreturntype used outside of main for loop
-    // mparamcount used outside of main for loop
-    // mparamtypes used outside of main for loop
+    /* exceptiontablelength */
+    /* raw_extable used outside of main for loop */
+    /* mreturntype used outside of main for loop */
+    /* mparamcount used outside of main for loop */
+    /* mparamtypes used outside of main for loop */
 
-    //local variables used in parse()  
+    /* local variables used in parse() */
 
     int  i;                     /* temporary for different uses (counters)*/
     int  p;                     /* java instruction counter               */
@@ -99,7 +99,7 @@ typedef struct {
 
 } t_inlining_stacknode;
 
-typedef struct t_inlining_globals {  // try in parse.h with struct not include
+typedef struct t_inlining_globals {  /* try in parse.h with struct not include */
         bool isinlinedmethod;
         int cumjcodelength;   /* cumulative immediate intruction length */
         int cummaxstack;
index c4f2daba8858386ecb104a85f93139a7f2b8c860..6399a8fd3b1176f0f9e1d52a5d104393b628d695 100644 (file)
--- a/jit/jit.c
+++ b/jit/jit.c
@@ -29,7 +29,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: jit.c 1478 2004-11-11 11:16:30Z twisti $
+   $Id: jit.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -1344,14 +1344,14 @@ static void* do_nothing_function()
 
 *******************************************************************************/
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
-                                                                       registerdata *rd, loopdata *ld,
-                                                                       t_inlining_globals *id);
+static functionptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                         registerdata *rd, loopdata *ld,
+                                                                         t_inlining_globals *id);
 
-methodptr jit_compile(methodinfo *m)
+functionptr jit_compile(methodinfo *m)
 {
        static bool jitrunning;
-       methodptr r;
+       functionptr r;
        s4 dumpsize;
        codegendata *cd;
        registerdata *rd;
@@ -1382,7 +1382,8 @@ methodptr jit_compile(methodinfo *m)
                if (compileverbose)
                        log_message_method("No code given for: ", m);
 
-               m->entrypoint = (methodptr) do_nothing_function;
+               /*m->entrypoint = (methodptr) do_nothing_function;*/
+               m->entrypoint = (functionptr) do_nothing_function;
 
                return m->entrypoint;    /* return empty method     */
        }
@@ -1417,8 +1418,8 @@ methodptr jit_compile(methodinfo *m)
 
        /* RTA static analysis must be called before inlining */
        if (opt_rt)
-               RT_jit_parse(m); // will be called just once
-                                /* return value ignored for now */
+               RT_jit_parse(m); /* will be called just once */
+                            /* return value ignored for now */
 
        /* must be called before reg_setup, because it can change maxlocals */
        /* init reqd to initialize for parse even in no inlining */
@@ -1485,9 +1486,9 @@ methodptr jit_compile(methodinfo *m)
 
 *******************************************************************************/
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
-                                                                       registerdata *rd, loopdata *ld,
-                                                                       t_inlining_globals *id)
+static functionptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                         registerdata *rd, loopdata *ld,
+                                                                         t_inlining_globals *id)
 {
        /* print log message for compiled method */
 
@@ -1616,7 +1617,7 @@ static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
                show_icmd_method(m, cd, rd);
 
        } else if (showdisassemble) {
-               disassemble((void *) (m->mcode + cd->dseglen), 
+               disassemble((void *) ((long) m->mcode + cd->dseglen), 
                                        m->mcodelength - cd->dseglen);
        }
 
index 2a8ddab4e6132c2ae93e2f7ffd788b904da82507..8c128be32b7b34654e3bed8f18c75d2c49b707f1 100644 (file)
--- a/jit/jit.h
+++ b/jit/jit.h
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: jit.h 1456 2004-11-05 14:33:14Z twisti $
+   $Id: jit.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -823,7 +823,7 @@ extern bool method_uses_edx;
 
 /* function prototypes */
 
-methodptr jit_compile(methodinfo *m);   /* compile a method with jit compiler */
+functionptr jit_compile(methodinfo *m); /* compile a method with jit compiler */
 
 void jit_init();                        /* compiler initialisation            */
 void jit_close();                       /* compiler finalisation              */
index 7802ac4d8fd6ee074cb14c9fa8ac78294431399e..530008a9154ad41eae8770fef65dfc9957b050ea 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Carolyn Oates
             Edwin Steiner
 
-   $Id: parse.c 1462 2004-11-06 15:08:49Z motse $
+   $Id: parse.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -79,7 +79,7 @@ bool DEBUG3 = false;
 bool DEBUG4 = false;  /*opcodes*/
 
 /*INLINING*/
-#define debug_writebranch if (DEBUG2==true) printf("op:: %s i: %d label_index[i]: %d label_index=%p\n",opcode_names[opcode], i, label_index[i],label_index);
+#define debug_writebranch if (DEBUG2==true) printf("op:: %s i: %d label_index[i]: %d label_index=0x%x\n",opcode_names[opcode], i, label_index[i], label_index);
 #define debug_writebranch1
 
 
@@ -365,12 +365,13 @@ static exceptiontable* fillextable(methodinfo *m,
        
        if (exceptiontablelength == 0) 
                return extable;
+
        
-//if (m->exceptiontablelength > 0) {
-//   DEBUGMETH(m);
-//   printf("m->exceptiontablelength=%i\n",m->exceptiontablelength);
-//   panic("exceptiontablelength > 0");
-//   }
+       /*if (m->exceptiontablelength > 0) {
+         DEBUGMETH(m);
+         printf("m->exceptiontablelength=%i\n",m->exceptiontablelength);
+         panic("exceptiontablelength > 0");
+         }*/
 
        b_count = *block_count;
 
@@ -384,7 +385,7 @@ static exceptiontable* fillextable(methodinfo *m,
                
 /*** if (DEBUG==true){printf("---------------------block_inserted:b_count=%i m->basicblockindex[(p=%i)]=%i=%p\n",b_count,p,m->basicblockindex[(p)],m->basicblockindex[(p)]); 
   fflush(stdout); } ***/   
-               p = raw_extable[i].endpc; // see JVM Spec 4.7.3
+               p = raw_extable[i].endpc; /* see JVM Spec 4.7.3 */
                if (p < raw_extable[i].startpc)
                        panic("Invalid exception handler range");
                if (p > m->jcodelength) { 
@@ -509,17 +510,20 @@ if (opt_rt) {
        memset(iptr, 0, sizeof(instruction) * (inline_env->cumjcodelength + 5));
        
        /* compute branch targets of exception table */
-//if (m->exceptiontable == NULL) {
-//  printf("m->exceptiontable=NULL\n");fflush(stdout);
-//  }
-//else {
-//  printf("m->exceptiontable != NULL\n");fflush(stdout);
-//  }
-//printf("m->exceptiontablelength=%i, inline_env->method->exceptiontablelength=%i,inline_env->cumextablelength=%i\n",
-//m->exceptiontablelength, inline_env->method->exceptiontablelength,inline_env->cumextablelength);
-
-//if (m->exceptiontablelength > 0)
-//     m->exceptiontable = DMNEW(exceptiontable, m->exceptiontablelength + 1); 
+       /*
+if (m->exceptiontable == NULL) {
+  printf("m->exceptiontable=NULL\n");fflush(stdout);
+  }
+else {
+  printf("m->exceptiontable != NULL\n");fflush(stdout);
+  }
+printf("m->exceptiontablelength=%i, inline_env->method->exceptiontablelength=%i,inline_env->cumextablelength=%i\n",
+m->exceptiontablelength, inline_env->method->exceptiontablelength,inline_env->cumextablelength);
+       */
+       /*
+if (m->exceptiontablelength > 0)
+       m->exceptiontable = DMNEW(exceptiontable, m->exceptiontablelength + 1); 
+       */
 
        nextex = fillextable(m, 
          cd->exceptiontable, m->exceptiontable, m->exceptiontablelength, 
@@ -570,7 +574,7 @@ if (opt_rt) {
                        bool *readonly = NULL;
                        int argBlockIdx=0;
 
-                       block_insert(gp);               //JJJJJJJJJJ
+                       block_insert(gp);               /* JJJJJJJJJJ */
                        blockend=false;
                        instructionstart[gp] = 1;
                        m->basicblockindex[gp] |= (ipc << 1);  /*FIXME: necessary ? */
@@ -614,8 +618,8 @@ if (opt_rt) {
                                        argBlockIdx--;
 
                                OP1(op, firstlocal + argBlockIdx);
-                               //OP1(op, firstlocal + tmpinlinf->method->paramcount - 1 - i);
-                       //printf("inline argument load operation for local: %ld\n",firstlocal + tmpinlinf->method->paramcount - 1 - i);
+                               /* OP1(op, firstlocal + tmpinlinf->method->paramcount - 1 - i); */
+                               /* printf("inline argument load operation for local: %ld\n",firstlocal + tmpinlinf->method->paramcount - 1 - i); */
                        }
                        skipBasicBlockChange=1;
 if (DEBUG==true) {
@@ -658,19 +662,22 @@ DEBUGMETH(inline_env->method);
                        printf("Parse p=%i<%i<%i<   opcode=<%i> %s\n",
                           p, gp, inline_env->jcodelength, opcode, opcode_names[opcode]);
                }
-         
-//printf("basicblockindex[gp=%i]=%i=%p ipc=%i=%p shifted ipc=%i=%p\n",
-//gp,m->basicblockindex[gp],m->basicblockindex[gp],ipc,ipc,(ipc<<1),(ipc<<1));
-//fflush(stdout);
+        /*
+printf("basicblockindex[gp=%i]=%i=%p ipc=%i=%p shifted ipc=%i=%p\n",
+gp,m->basicblockindex[gp],m->basicblockindex[gp],ipc,ipc,(ipc<<1),(ipc<<1));
+fflush(stdout);
+        */
                if (!skipBasicBlockChange) {
                        m->basicblockindex[gp] |= (ipc << 1); /*store intermed cnt*/
                } else skipBasicBlockChange=0;
-//printf("basicblockindex[gp=%i]=%i=%p \n",
-//gp,m->basicblockindex[gp],m->basicblockindex[gp]);
-//fflush(stdout);
+               /*
+printf("basicblockindex[gp=%i]=%i=%p \n",
+gp,m->basicblockindex[gp],m->basicblockindex[gp]);
+fflush(stdout);
+               */
 
                if (blockend) {
-//printf("B4 BEND\t"); fflush(stdout);
+                       /* printf("B4 BEND\t"); fflush(stdout); */
                        block_insert(gp);               /* start new block                */
                        blockend = false;
                        /*printf("blockend was set: new blockcount: %ld at:%ld\n",b_count,gp);*/
@@ -1010,7 +1017,7 @@ SHOWOPCODE
                                i = label_index[i];
                        }
                        bound_check(i);
-//printf("B6 JSR_W\t"); fflush(stdout);
+                       /*printf("B6 JSR_W\t"); fflush(stdout);*/
                        block_insert(i);
                        blockend = true;
                        OP1(opcode, i);
@@ -1047,12 +1054,13 @@ SHOWOPCODE
                                /*                                              break; */
                                /*                                      } */
                                if (nextp>inline_env->method->jcodelength-1) {
-                                  //OP1(ICMD_GOTO, inlinfo->stopgp);
-                                   //OP(ICMD_NOP);
-                                   //OP(ICMD_NOP);
-                                   blockend=true;
-                                   break;
-                                }//JJJJJJJ
+                                       /* OP1(ICMD_GOTO, inlinfo->stopgp);
+                                          OP(ICMD_NOP);
+                                          OP(ICMD_NOP);
+                                       */
+                                       blockend=true;
+                                       break;
+                               } /* JJJJJJJ */
                                blockend = true;
                                OP1(ICMD_GOTO, inlinfo->stopgp);
                                break;
@@ -1099,7 +1107,9 @@ SHOWOPCODE
                                tablep++;
                                nextp += 4;
                                bound_check(j);
-//printf("B7 LOOKUP1\t"); fflush(stdout);
+/*
+printf("B7 LOOKUP1\t"); fflush(stdout);
+*/
                                block_insert(j);
 
                                /* number of pairs */
@@ -1135,7 +1145,9 @@ SHOWOPCODE
                                        tablep++;
                                        nextp += 4;
                                        bound_check(j);
-//printf("B8 LOOKUP2\t"); fflush(stdout);
+/*
+printf("B8 LOOKUP2\t"); fflush(stdout);
+*/
                                        block_insert(j);
                                }
 
@@ -1171,7 +1183,9 @@ SHOWOPCODE
                                tablep++;
                                nextp += 4;
                                bound_check(j);
-//printf("B9 TABLESWITCH1\t"); fflush(stdout);
+/*
+printf("B9 TABLESWITCH1\t"); fflush(stdout);
+*/
                                block_insert(j);
 
                                /* lower bound */
@@ -1205,7 +1219,9 @@ SHOWOPCODE
                                        tablep++;
                                        nextp += 4;
                                        bound_check(j);
-//printf("B10 TABLESWITCH2\t"); fflush(stdout);
+/*
+printf("B10 TABLESWITCH2\t"); fflush(stdout);
+*/
                                        block_insert(j);
                                        /*printf("TABLESWITCH: block_insert(%ld)\n",j);*/
                                }
@@ -1307,7 +1323,7 @@ SHOWOPCODE
                                if (!mi)
                                        return NULL;
 
-                               /*RTAprint*/// if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt)
+                               /*RTAprint*/ /* if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt) */
 if (DEBUG4==true) 
                                        /*RTAprint*/    {printf(" method name =");
                                        /*RTAprint*/    utf_display(mi->class->name); printf(".");
@@ -1351,7 +1367,7 @@ if (DEBUG4==true)
                                if (!mi)
                                        return NULL;
 
-                               /*RTAprint*/ // if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt)
+                               /*RTAprint*/ /* if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt) */
 if (DEBUG4==true)
                                        /*RTAprint*/    {printf(" method name =");
                                        method_display(mi);
@@ -1651,18 +1667,18 @@ if (DEBUG4==true)
                
                /* INLINING */
                  
-//             if (inline_env->isinlinedmethod && p == inline_env->method->jcodelength - 1) { /* end of an inlined method */
+               /* if (inline_env->isinlinedmethod && p == inline_env->method->jcodelength - 1) { */ /* end of an inlined method */
                if (inline_env->isinlinedmethod && (nextp >= inline_env->method->jcodelength) ) { /* end of an inlined method */
                        /*                printf("setting gp from %d to %d\n",gp, inlinfo->stopgp); */
                        gp = inlinfo->stopgp; 
                        inlining_restore_compiler_variables();
-//label_index = inlinfo->label_index;
+/*label_index = inlinfo->label_index;*/
 if (DEBUG==true) {
 printf("AFTER RESTORE : "); fflush(stdout);
 DEBUGMETH(inline_env->method);
 }
                        list_remove(inlinfo->inlinedmethods, list_first(inlinfo->inlinedmethods));
-                       if (inlinfo->inlinedmethods == NULL) { //JJJJ
+                       if (inlinfo->inlinedmethods == NULL) { /* JJJJ */
                                nextgp = -1;
                        } else {
                                tmpinlinf = list_first(inlinfo->inlinedmethods);
@@ -1726,7 +1742,7 @@ DEBUGMETH(inline_env->method);
                /* allocate blocks */
 
                for (p = 0; p < inline_env->cumjcodelength; p++) { 
-//             for (p = 0; p < m->jcodelength; p++) { 
+               /* for (p = 0; p < m->jcodelength; p++) { */
                        if (m->basicblockindex[p] & 1) {
                                /* check if this block starts at the beginning of an instruction */
                                if (!instructionstart[p]) {
index 98cbe6fe2f460f77a97b48dc9ed71a31578eed90..0a1572c19e9f2d4f4a089ae3985e2b9b893e5c48 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Carolyn Oates
 
-   $Id: parseRT.c 1473 2004-11-10 10:33:59Z carolyn $
+   $Id: parseRT.c 1494 2004-11-12 13:34:26Z twisti $
 
 Changes:
 opcode put into functions
@@ -315,7 +315,7 @@ if (submeth->methodUsed == USED) return;
                        }
                }
         /* add method to rta work list if conditions met */
-       //if ( (submeth->class->classUsed == USED) ||
+       /* if ( (submeth->class->classUsed == USED) || */
        if (class->classUsed == USED) {
                submeth->monoPoly = POLY;
                addToRtaWorkList(submeth,
@@ -491,7 +491,7 @@ if (DEBUGr) printf("\n");
                                                        true);
 
                                if (!fi)
-                                       return 0; // was NULL
+                                       return 0; /* was NULL */
 
                                CLASSNAME(fi->class,"\tPUTSTATIC: ");
                                if (!fi->class->initialized) {
@@ -665,7 +665,7 @@ utf_display(mr->descriptor); printf("\n");fflush(stdout);
                                           }
                                /* see INVOKESTATIC for explanation about */
                                /*   case when Interface is not resolved  */
-                                //descriptor2types(mi); ?? do need paramcnt?
+                                /* descriptor2types(mi); ?? do need paramcnt? */
                         }
                         break;
 
@@ -677,8 +677,8 @@ utf_display(mr->descriptor); printf("\n");fflush(stdout);
                        classinfo *ci;
                         ci = class_getconstant(m->class, i, CONSTANT_Class);
                         m->isleafmethod = false; /* why for new ? */
-                        // s_count++; look for s_counts for VTA
-                       //ci->classUsed=USED;
+                        /* s_count++; look for s_counts for VTA */
+                                               /* ci->classUsed=USED; */
                        /* add marked methods */
                        CLASSNAME(ci,"NEW : do nothing");
                        }
@@ -776,7 +776,7 @@ methodinfo *initializeRTAworklist(methodinfo *m) {
 
        /*----- rtMissedIn 0 */
         if ( (rtMissedIn = fopen("rtMissedIn0", "r")) == NULL) {
-               //if (verbose) 
+                       /* if (verbose) */
                    {printf("No rtMissedIn0 file\n");fflush(stdout);} 
                return  rm;
                }
@@ -793,7 +793,7 @@ printf("filenameIn=%s|mainstring=%s\n",filenameIn,mainstring); fflush(stdout);
         strcat(filenameIn, (const char *)mainstring);  
 printf("filenameIn=%s|\n",filenameIn); fflush(stdout);
         if ( (rtMissedIn = fopen(filenameIn, "r")) == NULL) {
-               //if (verbose) 
+                       /* if (verbose) */
                    {printf("NNo rtMissedIn=%s file\n",filenameIn);fflush(stdout);} 
                return rm;
                }
index 0db7b44b4330052a4345de3c665bdedaca348e53..2f5f6efc45021fdbd746d348ffbfbe7594e2030c 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Carolyn Oates
 
-   $Id: parseRTstats.c 1469 2004-11-08 21:08:13Z carolyn $
+   $Id: parseRTstats.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 #include <stdio.h>
@@ -445,7 +445,7 @@ printf("RT Heirarchy:------------\n"); fflush(stdout);
                }
     }
        printRTClassHeirarchy(class_java_lang_Object);
-       //printRTClassHeirarchy(m->class);
+       /* printRTClassHeirarchy(m->class); */
        if (pClassHeirStatsOnly >= 2) {
                fflush(stdout);
                printf("--- end  of RT info ---------------\n");
index d5780f759a0149b8f0e69b5405a353afd96b524c..1e0cd4e1f5c7e3307ba36390eda2f4961e59a749 100644 (file)
--- a/jit/reg.h
+++ b/jit/reg.h
@@ -27,7 +27,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: reg.h 1456 2004-11-05 14:33:14Z twisti $
+   $Id: reg.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
 #include "jit/jit.h"
 
 
-typedef struct registerdata registerdata;
+/************************* pseudo variable structure **************************/
+
 typedef struct varinfo varinfo;
+
+struct varinfo {
+       int type;                   /* basic type of variable                     */
+       int flags;                  /* flags (SAVED, INMEMORY)                    */
+       int regoff;                 /* register number or memory offset           */
+};
+
 typedef struct varinfo varinfo5[5];
 
-//struct t_inlining_globals;
 
+typedef struct registerdata registerdata;
 
 struct registerdata {
        varinfo5 *locals;
@@ -117,15 +125,6 @@ struct registerdata {
 };
 
 
-/************************* pseudo variable structure **************************/
-
-struct varinfo {
-       int type;                   /* basic type of variable                     */
-       int flags;                  /* flags (SAVED, INMEMORY)                    */
-       int regoff;                 /* register number or memory offset           */
-};
-
-
 /* function prototypes */
 
 void reg_init();
index fec9ba945c5efd9aa449188eb0e94607d466e54e..541c7fa40d0a1cb9a1eff6f0713f0a9d8368dfbd 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 1466 2004-11-08 11:24:50Z twisti $
+   $Id: codegen.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -123,7 +123,7 @@ void catch_NullPointerException(int sig, siginfo_t *siginfo, void *_p)
 /*     faultaddr = sigctx->sc_regs[(instr >> 16) & 0x1f]; */
 
 /*     if (faultaddr == 0) { */
-       act.sa_sigaction = (void *) catch_NullPointerException; /* reinstall handler */
+       act.sa_sigaction = (functionptr) catch_NullPointerException; /* reinstall handler */
        act.sa_flags = SA_SIGINFO;
        sigaction(sig, &act, NULL);
        
@@ -160,7 +160,7 @@ void catch_ArithmeticException(int sig, siginfo_t *siginfo, void *_p)
 
        /* Reset signal handler - necessary for SysV, does no harm for BSD */
 
-       act.sa_sigaction = (void *) catch_ArithmeticException; /* reinstall handler */
+       act.sa_sigaction = (functionptr) catch_ArithmeticException; /* reinstall handler */
        act.sa_flags = SA_SIGINFO;
        sigaction(sig, &act, NULL);
 
@@ -187,19 +187,19 @@ void init_exceptions(void)
 
        if (!checknull) {
 #if defined(SIGSEGV)
-               act.sa_sigaction = (void *) catch_NullPointerException;
+               act.sa_sigaction = (functionptr) catch_NullPointerException;
                act.sa_flags = SA_SIGINFO;
                sigaction(SIGSEGV, &act, NULL);
 #endif
 
 #if defined(SIGBUS)
-               act.sa_sigaction = (void *) catch_NullPointerException;
+               act.sa_sigaction = (functionptr) catch_NullPointerException;
                act.sa_flags = SA_SIGINFO;
                sigaction(SIGBUS, &act, NULL);
 #endif
        }
 
-       act.sa_sigaction = (void *) catch_ArithmeticException;
+       act.sa_sigaction = (functionptr) catch_ArithmeticException;
        act.sa_flags = SA_SIGINFO;
        sigaction(SIGFPE, &act, NULL);
 }
diff --git a/jni.c b/jni.c
index 89f60da56ad94198678cdb99d998b704a27843f1..7fa2d28e0131cbbedf588848cd5f392cdae877f9 100644 (file)
--- a/jni.c
+++ b/jni.c
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger, Martin Platter
 
-   $Id: jni.c 1471 2004-11-09 11:54:53Z motse $
+   $Id: jni.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -3226,7 +3226,7 @@ void jni_init(){
 
        initrunning = true;
        log_text("JNI-Init: initialize global_ref_table");
-       // initalize global reference table
+       /* initalize global reference table */
        ihmclass = FindClass(NULL, "java/util/IdentityHashMap");
        
        if (ihmclass == NULL) {
@@ -3578,8 +3578,9 @@ jobject *jni_method_invokeNativeHelper(JNIEnv *env, struct methodinfo *methodID,
 
 
        if (!(methodID->flags & ACC_STATIC) && (!obj))  {
-               *exceptionptr = new_exception_message(string_java_lang_NullPointerException,
-                                                                                         "Static mismatch in Java_java_lang_reflect_Method_invokeNative");
+               *exceptionptr =
+                       new_exception_message(string_java_lang_NullPointerException,
+                                                                 "Static mismatch in Java_java_lang_reflect_Method_invokeNative");
                return 0;
        }
 
index f34206f4cc36ae6f4f354b0584972fb319e455f4..75b607b0d45c1c217fe2ef770cc454e988dc22af 100644 (file)
--- a/loader.c
+++ b/loader.c
@@ -32,7 +32,7 @@
             Edwin Steiner
             Christian Thalinger
 
-   $Id: loader.c 1443 2004-11-05 13:53:13Z twisti $
+   $Id: loader.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -1900,12 +1900,13 @@ static bool class_loadcpool(classbuffer *cb, classinfo *c)
                                return false;
 
                        if (opt_verify &&
-                               !is_valid_utf(cb->pos + 1, cb->pos + 1 + length)) {
+                               !is_valid_utf((char *) (cb->pos + 1),
+                                                         (char *) (cb->pos + 1 + length))) {
                                dolog("Invalid UTF-8 string (constant pool index %d)",idx);
                                panic("Invalid UTF-8 string");
                        }
                        /* insert utf-string into the utf-symboltable */
-                       cpinfos[idx] = utf_new_intern(cb->pos + 1, length);
+                       cpinfos[idx] = utf_new_intern((char *) (cb->pos + 1), length);
 
                        /* skip bytes of the string (buffer size check above) */
                        skip_nbytes(cb, length);
@@ -2907,7 +2908,7 @@ static classinfo *class_link_intern(classinfo *c)
                                return NULL;
 
                if (super->flags & ACC_INTERFACE) {
-                       // java.lang.IncompatibleClassChangeError: class a has interface java.lang.Cloneable as super class
+                       /* java.lang.IncompatibleClassChangeError: class a has interface java.lang.Cloneable as super class */
                        panic("Interface specified as super class");
                }
 
@@ -2956,7 +2957,7 @@ static classinfo *class_link_intern(classinfo *c)
                                                        goto notfoundvftblindex;
 
                                                if (tc->methods[j].flags & ACC_FINAL) {
-                                                       // class a overrides final method .
+                                                       /* class a overrides final method . */
                                                        *exceptionptr =
                                                                new_exception(string_java_lang_VerifyError);
                                                        return NULL;
index df8043b64bebedec3bccd43ea5f97ac6d120fbf0..86289145ecb5704a57e0de63faad7e071c9942c0 100644 (file)
 #      ifndef __INTEL_COMPILER
         __asm__ __volatile__("st4.rel %0=r0" : "=m" (*addr) : : "memory");
 #      else
-       // there is no st4 but I can use xchg I hope
+         /* there is no st4 but I can use xchg I hope */
         _InterlockedExchange(addr, 0);
 #      endif
        }
index 94b446b6796cae8ee56b03483f2027cc7006f39a..7589127e426119ea763fa9c3847fee2e3f10f27c 100644 (file)
              __lfetch(__lfhint_nta,  (x))
 #          define CLEAR_DOUBLE(x) \
              __stf_spill((void *)(x), 0)
-#        endif // __INTEL_COMPILER
+#        endif /* __INTEL_COMPILER */
 #       endif
 #   endif
 #   ifdef MSWIN32
index 9f5d2a4e83e1966b9c533313e87c416da580e9b6..75f8f3ff779c2fe7d5c7005c03a5ca84a9d427dd 100644 (file)
@@ -94,7 +94,7 @@ JNIEXPORT void JNICALL Java_java_lang_JOWENNTest1_f6 (JNIEnv *env ,  struct java
        jmethodID mid;
 
        printf("JOWENNTest1_nat_f6:%d\n",par1);
-//     class_showmethods(this->header.vftbl->class);
+        /*class_showmethods(this->header.vftbl->class);*/
         mid = (*env)->GetMethodID(env, this->header.vftbl->class, "f6a", "(I)V");
 
         (*env)->CallVoidMethod(env, this, mid,par1);
@@ -118,7 +118,7 @@ JNIEXPORT void JNICALL Java_java_lang_JOWENNTest1_f7 (JNIEnv *env ,  struct java
        jmethodID mid;
 
        printf("JOWENNTest1_nat_f7\n");
-//     class_showmethods(this->header.vftbl->class);
+        /*class_showmethods(this->header.vftbl->class);*/
         mid = (*env)->GetMethodID(env, this->header.vftbl->class, "f7a", "(III)V");
 
         (*env)->CallVoidMethod(env, this, mid,1,2,3);
@@ -141,7 +141,7 @@ JNIEXPORT void JNICALL Java_java_lang_JOWENNTest1_f8 (JNIEnv *env ,  struct java
        jmethodID mid;
 
        printf("JOWENNTest1_nat_f8\n");
-//     class_showmethods(this->header.vftbl->class);
+        /*class_showmethods(this->header.vftbl->class);*/
         mid = (*env)->GetStaticMethodID(env, this->header.vftbl->class, "f7a", "(III)V");
 
         (*env)->CallStaticVoidMethod(env, this, mid,1,2,3);
@@ -161,7 +161,7 @@ JNIEXPORT void JNICALL Java_java_lang_JOWENNTest1_f9 (JNIEnv *env ,  struct java
        jmethodID mid;
 
        printf("JOWENNTest1_nat_f9\n");
-//     class_showmethods(this->header.vftbl->class);
+        /*class_showmethods(this->header.vftbl->class);*/
         mid = (*env)->GetStaticMethodID(env, this->header.vftbl->class, "f7b", "(III)V");
 
         (*env)->CallVoidMethod(env, this, mid,1,2,3);
index d6cbb0d833fdfca138014fe497aceb29b7e1d675..ad42162666f009773f4fc22dbe00fb2e7b84df05 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Joseph Wenninger
             Christian Thalinger
 
-   $Id: Runtime.c 1487 2004-11-12 11:25:19Z twisti $
+   $Id: Runtime.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -205,12 +205,12 @@ JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalizationForExit(JNIEnv *e
 {
 /*     if (finalizeOnExit) { */
 /*             gc_call(); */
-       //      gc_finalize_all();
+       /* gc_finalize_all(); */
 /*     } */
 /*     log_text("Java_java_lang_VMRuntime_runFinalizationForExit called"); */
-       //gc_finalize_all();
-       //gc_invoke_finalizers();
-       //gc_call();
+       /*gc_finalize_all();*/
+       /*gc_invoke_finalizers();*/
+       /*gc_call();*/
 }
 
 
index df8043b64bebedec3bccd43ea5f97ac6d120fbf0..86289145ecb5704a57e0de63faad7e071c9942c0 100644 (file)
 #      ifndef __INTEL_COMPILER
         __asm__ __volatile__("st4.rel %0=r0" : "=m" (*addr) : : "memory");
 #      else
-       // there is no st4 but I can use xchg I hope
+         /* there is no st4 but I can use xchg I hope */
         _InterlockedExchange(addr, 0);
 #      endif
        }
index 94b446b6796cae8ee56b03483f2027cc7006f39a..7589127e426119ea763fa9c3847fee2e3f10f27c 100644 (file)
              __lfetch(__lfhint_nta,  (x))
 #          define CLEAR_DOUBLE(x) \
              __stf_spill((void *)(x), 0)
-#        endif // __INTEL_COMPILER
+#        endif /* __INTEL_COMPILER */
 #       endif
 #   endif
 #   ifdef MSWIN32
index c6c1f07fd245bf4ae4e0b30fae24bb84072e39a6..8bb630e7c9394aeae0e984206c6dfcae69454f00 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: memory.c 1489 2004-11-12 11:31:47Z twisti $
+   $Id: memory.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -207,7 +207,7 @@ void *dump_alloc(int size)
                }
 
                /* allocate dumpblock memory */
-               //printf("new dumpblock: %d\n", newdumpblocksize);
+               /*printf("new dumpblock: %d\n", newdumpblocksize);*/
                newdumpblock->dumpmem = checked_alloc(newdumpblocksize);
 
                newdumpblock->prev = di->currentdumpblock;
@@ -216,7 +216,7 @@ void *dump_alloc(int size)
 
                /* Used dump size is previously allocated dump size, because the      */
                /* remaining free memory of the previous dump block cannot be used.   */
-               //printf("unused memory: %d\n", allocateddumpsize - useddumpsize);
+               /*printf("unused memory: %d\n", allocateddumpsize - useddumpsize);*/
                di->useddumpsize = di->allocateddumpsize;
 
                /* increase the allocated dump size by the size of the new dump block */
index 99ec0cec88078d17a58f9aebc30afdc64c097a0c..c87df8b271d06bb364923f23f3d1d093597465c8 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: memory.h 1437 2004-11-05 09:51:07Z twisti $
+   $Id: memory.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -102,7 +102,7 @@ typedef struct dumpblock dumpblock;
 
 struct dumpblock {
        dumpblock *prev;
-       void      *dumpmem;
+       u1        *dumpmem;
        s4         size;
 };
 
index 89f60da56ad94198678cdb99d998b704a27843f1..7fa2d28e0131cbbedf588848cd5f392cdae877f9 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger, Martin Platter
 
-   $Id: jni.c 1471 2004-11-09 11:54:53Z motse $
+   $Id: jni.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -3226,7 +3226,7 @@ void jni_init(){
 
        initrunning = true;
        log_text("JNI-Init: initialize global_ref_table");
-       // initalize global reference table
+       /* initalize global reference table */
        ihmclass = FindClass(NULL, "java/util/IdentityHashMap");
        
        if (ihmclass == NULL) {
@@ -3578,8 +3578,9 @@ jobject *jni_method_invokeNativeHelper(JNIEnv *env, struct methodinfo *methodID,
 
 
        if (!(methodID->flags & ACC_STATIC) && (!obj))  {
-               *exceptionptr = new_exception_message(string_java_lang_NullPointerException,
-                                                                                         "Static mismatch in Java_java_lang_reflect_Method_invokeNative");
+               *exceptionptr =
+                       new_exception_message(string_java_lang_NullPointerException,
+                                                                 "Static mismatch in Java_java_lang_reflect_Method_invokeNative");
                return 0;
        }
 
index 13df6b4765aab3c3c833d8191e552b5a518fcb6a..8f8c6b996ec7d067decd51f7472a1fe306821af0 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Joseph Wenninger
             Christian Thalinger
 
-   $Id: VMRuntime.c 1487 2004-11-12 11:25:19Z twisti $
+   $Id: VMRuntime.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -205,12 +205,12 @@ JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalizationForExit(JNIEnv *e
 {
 /*     if (finalizeOnExit) { */
 /*             gc_call(); */
-       //      gc_finalize_all();
+       /* gc_finalize_all(); */
 /*     } */
 /*     log_text("Java_java_lang_VMRuntime_runFinalizationForExit called"); */
-       //gc_finalize_all();
-       //gc_invoke_finalizers();
-       //gc_call();
+       /*gc_finalize_all();*/
+       /*gc_invoke_finalizers();*/
+       /*gc_call();*/
 }
 
 
index ffea741a4c160dab5c0147d1e4a37a69e52ea80c..b52cf4853a7986c94245c44200ee42520308e066 100644 (file)
@@ -27,6 +27,7 @@
 #include <errno.h>
 
 #include "config.h"
+#include "exceptions.h"
 #include "thread.h"
 #include "locks.h"
 #include "tables.h"
index 1c1eee4c6cbaeb25c93cfa95d732bc6e5b3c5bb6..0a8d5b138f666ef66b16d30d2aba4de7f928dabd 100644 (file)
@@ -202,7 +202,7 @@ extern thread *threadQhead[MAX_THREAD_PRIO + 1];
 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
 u1*  asm_initialize_thread_stack(void *func, u1 *stack);
 
-#else // defined(NATIVE_THREADS)
+#else /* NATIVE_THREADS */
 #include "nativethread.h"
 #endif
 
index c9c8fcffbf40aa51ff7482416878c415a0c2ab64..d55917b2d926eeceea1022c997021eaeb5196f79 100644 (file)
@@ -48,7 +48,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen.inc 1475 2004-11-11 10:27:49Z twisti $
+   $Id: codegen.inc 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -93,15 +93,15 @@ void codegen_init()
 
                mte = NEW(methodtree_element);
 
-               mte->startpc = asm_calljavafunction;
-               mte->endpc = asm_calljavafunction2 - 1;
+               mte->startpc = (functionptr) asm_calljavafunction;
+               mte->endpc = (functionptr) ((long) asm_calljavafunction2 - 1);
 
                avl_insert(methodtree, mte);
 
                mte = NEW(methodtree_element);
 
-               mte->startpc = asm_calljavafunction2;
-               mte->endpc = asm_call_jit_compiler - 1;
+               mte->startpc = (functionptr) asm_calljavafunction2;
+               mte->endpc = (functionptr) ((long) asm_call_jit_compiler - 1);
 
                avl_insert(methodtree, mte);
        }
@@ -547,11 +547,13 @@ static int methodtree_comparator(const void *pc, const void *element, void *para
        /* compare both startpc and endpc of pc, even if they have the same value,
           otherwise the avl_probe sometimes thinks the element is already in the
           tree */
-       if (mte->startpc <= mtepc->startpc && mtepc->startpc <= mte->endpc &&
-               mte->startpc <= mtepc->endpc   && mtepc->endpc   <= mte->endpc) {
+       if ((long) mte->startpc <= (long) mtepc->startpc &&
+               (long) mtepc->startpc <= (long) mte->endpc &&
+               (long) mte->startpc <= (long) mtepc->endpc &&
+               (long) mtepc->endpc <= (long) mte->endpc) {
                return 0;
 
-       } else if (mtepc->startpc < mte->startpc) {
+       } else if ((long) mtepc->startpc < (long) mte->startpc) {
                return -1;
 
        } else {
@@ -577,7 +579,7 @@ void *codegen_findmethod1(void *pc)
 #endif
 
 
-void codegen_insertmethod(void *startpc, void *endpc)
+void codegen_insertmethod(functionptr startpc, functionptr endpc)
 {
        methodtree_element *mte;
 
@@ -609,7 +611,7 @@ void codegen_insertmethod(void *startpc, void *endpc)
 }
 
 
-void *codegen_findmethod(void *pc)
+functionptr codegen_findmethod(functionptr pc)
 {
        methodtree_element *mtepc;
        methodtree_element *mte;
@@ -652,7 +654,7 @@ void *codegen_findmethod(void *pc)
 static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
 {
        jumpref *jr;
-       u1 *epoint;
+       functionptr epoint;
        s4 extralen;
        s4 alignedlen;
 
@@ -673,17 +675,18 @@ static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
        alignedlen = ALIGN(mcodelen, MAX_ALIGN) + cd->dseglen;
 
        m->mcodelength = mcodelen + cd->dseglen;
-       m->mcode = CNEW(u1, alignedlen + extralen);
+       m->mcode = (functionptr) (long) CNEW(u1, alignedlen + extralen);
 
-       memcpy(m->mcode, cd->dsegtop - cd->dseglen, cd->dseglen);
-       memcpy(m->mcode + cd->dseglen, cd->mcodebase, mcodelen);
+       memcpy((void *) (long) m->mcode, cd->dsegtop - cd->dseglen, cd->dseglen);
+       memcpy((void *) ((long) m->mcode + cd->dseglen), cd->mcodebase, mcodelen);
 
-       m->entrypoint = epoint = (u1 *) (m->mcode + cd->dseglen);
+       m->entrypoint = epoint = (functionptr) ((long) m->mcode + cd->dseglen);
 
        /* jump table resolving */
        jr = cd->jumpreferences;
        while (jr != NULL) {
-               *((void**) (epoint + jr->tablepos)) = epoint + jr->target->mpc;
+               *((functionptr *) ((long) epoint + jr->tablepos)) =
+                       (functionptr) ((long) epoint + (long) jr->target->mpc);
                jr = jr->next;
        }
 
@@ -717,12 +720,14 @@ static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
                dataref *dr;
 
                /* add method into methodtree to find the entrypoint */
-               codegen_insertmethod(m->entrypoint, m->entrypoint + mcodelen);
+               codegen_insertmethod(m->entrypoint,
+                                                        (functionptr) ((long) m->entrypoint + mcodelen));
 
                /* data segment references resolving */
                dr = cd->datareferences;
                while (dr != NULL) {
-                       *((void**) ((long) epoint + (long) dr->pos - POINTERSIZE)) = epoint;
+                       *((functionptr *) ((long) epoint + (long) dr->pos - POINTERSIZE)) =
+                               epoint;
                        dr = dr->next;
                }
        }
@@ -730,14 +735,14 @@ static void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen)
 
 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
        {
-               threadcritnode *n = (threadcritnode *) (m->mcode + alignedlen);
+               threadcritnode *n = (threadcritnode *) ((long) m->mcode + alignedlen);
                s4 i;
                threadcritnodetemp *nt = cd->threadcrit;
 
                for (i = 0; i < cd->threadcritcount; i++) {
-                       n->mcodebegin = m->mcode + nt->mcodebegin;
-                       n->mcodeend = m->mcode + nt->mcodeend;
-                       n->mcoderestart = m->mcode + nt->mcoderestart;
+                       n->mcodebegin = (u1 *) (long) m->mcode + nt->mcodebegin;
+                       n->mcodeend = (u1 *) (long) m->mcode + nt->mcodeend;
+                       n->mcoderestart = (u1 *) (long) m->mcode + nt->mcoderestart;
                        thread_registercritical(n);
                        n++;
                        nt = nt->next;
@@ -752,13 +757,13 @@ void dseg_display(methodinfo *m, codegendata *cd)
        s4 *s4ptr;
        s4 i;
        
-       s4ptr = (s4 *) m->mcode;
+       s4ptr = (s4 *) (long) m->mcode;
 
        printf("  --- dump of datasegment\n");
        for (i = cd->dseglen; i > 0 ; i -= 4) {
                printf("-%6x: %8x\n", i, (s4) (*s4ptr++));
        }
-       printf("  --- begin of data segment: %p\n", s4ptr);
+       printf("  --- begin of data segment: %p\n", (void *) s4ptr);
 }
 
 
index b85f09332a2ab542fec7e4cca2e64f6e97ba3035..b91cd4cee90ae4a6962ff3bf6c826dbd1dd9e717 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: codegen.inc.h 1458 2004-11-05 15:33:49Z twisti $
+   $Id: codegen.inc.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -149,8 +149,8 @@ struct linenumberref {
 typedef struct _methodtree_element methodtree_element;
 
 struct _methodtree_element {
-       void *startpc;
-       void *endpc;
+       functionptr startpc;
+       functionptr endpc;
 };
 #endif
 
@@ -162,7 +162,7 @@ void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *e);
 void codegen(methodinfo *m, codegendata *cd, registerdata *rd);
 void codegen_free(methodinfo *m, codegendata *cd);
 void codegen_close();
-void codegen_insertmethod(void *startpc, void *endpc);
+void codegen_insertmethod(functionptr startpc, functionptr endpc);
 
 #if defined(__I386__) || defined(__X86_64__)
 void codegen_addreference(codegendata *cd, struct basicblock *target, void *branchptr);
index 3ba36d216f8d1b446ab03fa422d5a8b0f329b310..7afd8a6b21f78e8aa69ddd265d1ef517b5c59168 100644 (file)
@@ -28,7 +28,7 @@ globals moved to structure and passed as parameter
 
    Authors: Dieter Thuernbeck
 
-   $Id: inline.c 1474 2004-11-11 10:09:10Z carolyn $
+   $Id: inline.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -58,9 +58,9 @@ globals moved to structure and passed as parameter
   printf("m->maxstack=%i;\n",m->maxstack); fflush(stdout);
 
 bool DEBUGi = false;
-// checked functions and macros: LOADCONST code_get OP1 BUILTIN block_insert bound_check ALIGN
+/* checked functions and macros: LOADCONST code_get OP1 BUILTIN block_insert bound_check ALIGN */
 
-// replace jcodelength loops with correct number after main for loop in parse()!
+/* replace jcodelength loops with correct number after main for loop in parse()! */
 
 
 /*-----------------------------------------------------------*/
@@ -77,7 +77,7 @@ void inlining_init0(methodinfo *m, t_inlining_globals *inline_env)
        inline_env->cummaxstack = m->maxstack; /*why has here been 0 ? */
        inline_env->cumextablelength = 0;
        inline_env->cumlocals = m->maxlocals;
-       inline_env->cummethods = 0;//co not global or static-used only here?
+       inline_env->cummethods = 0; /* co not global or static-used only here? */
        inline_env->inlining_stack = NULL;
        inline_env->inlining_rootinfo = NULL;
 }
@@ -112,11 +112,13 @@ if (DEBUGi==true) {print_t_inlining_globals(inline_env);}
                = inlining_analyse_method(m, 0, 0, 0, 0, inline_env);
 if (DEBUGi==true) {print_t_inlining_globals(inline_env);}
         /*---------------------*/
-       //if (inline_env->cummethods == 0) {
-       //  inline_env = DNEW(t_inlining_globals);
-       //  inlining_init0(m,inline_env);
-       //  return inline_env;
-        //  }
+/*
+ if (inline_env->cummethods == 0) {
+        inline_env = DNEW(t_inlining_globals);
+        inlining_init0(m,inline_env);
+        return inline_env;
+ }
+*/
 if (DEBUGi==true) {
   printf("(l,s) (%i,%i) was (%i,%i)\n",
     m->maxlocals, inline_env->cumlocals,
@@ -334,7 +336,7 @@ inlining_methodinfo *inlining_analyse_method(methodinfo *m,
        bool isnotrootlevel = (level > 0);
        bool isnotleaflevel = (level < INLINING_MAXDEPTH);
 
-       //      if (level == 0) gp = 0;
+       /* if (level == 0) gp = 0; */
        /*
        sprintf (logtext, "Performing inlining analysis of: ");
        utf_sprint (logtext+strlen(logtext), m->class->name);
@@ -344,7 +346,7 @@ inlining_methodinfo *inlining_analyse_method(methodinfo *m,
        dolog (); */
 
        if (isnotrootlevel) {
-               newnode->readonly = readonly = DMNEW(bool, m->maxlocals); //FIXME only paramcount entrys necessary
+               newnode->readonly = readonly = DMNEW(bool, m->maxlocals); /* FIXME only paramcount entrys necessary */
                for (i = 0; i < m->maxlocals; readonly[i++] = true);
                isnotrootlevel = true;
 
@@ -551,7 +553,7 @@ inlining_methodinfo *inlining_analyse_method(methodinfo *m,
                                                (imi->jcodelength < INLINING_MAXCODESIZE) && 
                                                (imi->jcodelength > 0) && 
                                               (((!inlinevirtuals)  || (uniqueVirt)) || (opcode != JAVA_INVOKEVIRTUAL)) &&
-                                               (inlineexceptions || (imi->exceptiontablelength == 0))) { //FIXME: eliminate empty methods?
+                                               (inlineexceptions || (imi->exceptiontablelength == 0))) { /* FIXME: eliminate empty methods? */
                                                inlining_methodinfo *tmp;
                                                descriptor2types(imi);
 
index 84f66c8ad2dbbc2ebb2a8c93ff7a0377fbad3b24..6c40deb6748e3201bf91e03d8e9c619aad90bfd5 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Dieter Thuernbeck
 
-   $Id: inline.h 1456 2004-11-05 14:33:14Z twisti $
+   $Id: inline.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -66,27 +66,27 @@ typedef struct {
 typedef struct {
     listnode linkage;
         
-    // saved static compiler variables
+    /* saved static compiler variables */
         
     methodinfo *method;
         
-    // restored through method
+    /* restored through method */
 
-    // int jcodelength;
-    // u1 *jcode;
-    // classinfo *class;
+    /* int jcodelength; */
+    /* u1 *jcode; */
+       /* classinfo *class; */
 
-    // descriptor never used
-    // maxstack used outside of main for loop
-    // maxlocals never used
+    /* descriptor never used */
+    /* maxstack used outside of main for loop */
+    /* maxlocals never used */
        
-    // exceptiontablelength
-    // raw_extable used outside of main for loop
-    // mreturntype used outside of main for loop
-    // mparamcount used outside of main for loop
-    // mparamtypes used outside of main for loop
+    /* exceptiontablelength */
+    /* raw_extable used outside of main for loop */
+    /* mreturntype used outside of main for loop */
+    /* mparamcount used outside of main for loop */
+    /* mparamtypes used outside of main for loop */
 
-    //local variables used in parse()  
+    /* local variables used in parse() */
 
     int  i;                     /* temporary for different uses (counters)*/
     int  p;                     /* java instruction counter               */
@@ -99,7 +99,7 @@ typedef struct {
 
 } t_inlining_stacknode;
 
-typedef struct t_inlining_globals {  // try in parse.h with struct not include
+typedef struct t_inlining_globals {  /* try in parse.h with struct not include */
         bool isinlinedmethod;
         int cumjcodelength;   /* cumulative immediate intruction length */
         int cummaxstack;
index 98cbe6fe2f460f77a97b48dc9ed71a31578eed90..0a1572c19e9f2d4f4a089ae3985e2b9b893e5c48 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Carolyn Oates
 
-   $Id: parseRT.c 1473 2004-11-10 10:33:59Z carolyn $
+   $Id: parseRT.c 1494 2004-11-12 13:34:26Z twisti $
 
 Changes:
 opcode put into functions
@@ -315,7 +315,7 @@ if (submeth->methodUsed == USED) return;
                        }
                }
         /* add method to rta work list if conditions met */
-       //if ( (submeth->class->classUsed == USED) ||
+       /* if ( (submeth->class->classUsed == USED) || */
        if (class->classUsed == USED) {
                submeth->monoPoly = POLY;
                addToRtaWorkList(submeth,
@@ -491,7 +491,7 @@ if (DEBUGr) printf("\n");
                                                        true);
 
                                if (!fi)
-                                       return 0; // was NULL
+                                       return 0; /* was NULL */
 
                                CLASSNAME(fi->class,"\tPUTSTATIC: ");
                                if (!fi->class->initialized) {
@@ -665,7 +665,7 @@ utf_display(mr->descriptor); printf("\n");fflush(stdout);
                                           }
                                /* see INVOKESTATIC for explanation about */
                                /*   case when Interface is not resolved  */
-                                //descriptor2types(mi); ?? do need paramcnt?
+                                /* descriptor2types(mi); ?? do need paramcnt? */
                         }
                         break;
 
@@ -677,8 +677,8 @@ utf_display(mr->descriptor); printf("\n");fflush(stdout);
                        classinfo *ci;
                         ci = class_getconstant(m->class, i, CONSTANT_Class);
                         m->isleafmethod = false; /* why for new ? */
-                        // s_count++; look for s_counts for VTA
-                       //ci->classUsed=USED;
+                        /* s_count++; look for s_counts for VTA */
+                                               /* ci->classUsed=USED; */
                        /* add marked methods */
                        CLASSNAME(ci,"NEW : do nothing");
                        }
@@ -776,7 +776,7 @@ methodinfo *initializeRTAworklist(methodinfo *m) {
 
        /*----- rtMissedIn 0 */
         if ( (rtMissedIn = fopen("rtMissedIn0", "r")) == NULL) {
-               //if (verbose) 
+                       /* if (verbose) */
                    {printf("No rtMissedIn0 file\n");fflush(stdout);} 
                return  rm;
                }
@@ -793,7 +793,7 @@ printf("filenameIn=%s|mainstring=%s\n",filenameIn,mainstring); fflush(stdout);
         strcat(filenameIn, (const char *)mainstring);  
 printf("filenameIn=%s|\n",filenameIn); fflush(stdout);
         if ( (rtMissedIn = fopen(filenameIn, "r")) == NULL) {
-               //if (verbose) 
+                       /* if (verbose) */
                    {printf("NNo rtMissedIn=%s file\n",filenameIn);fflush(stdout);} 
                return rm;
                }
index 0db7b44b4330052a4345de3c665bdedaca348e53..2f5f6efc45021fdbd746d348ffbfbe7594e2030c 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Carolyn Oates
 
-   $Id: parseRTstats.c 1469 2004-11-08 21:08:13Z carolyn $
+   $Id: parseRTstats.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 #include <stdio.h>
@@ -445,7 +445,7 @@ printf("RT Heirarchy:------------\n"); fflush(stdout);
                }
     }
        printRTClassHeirarchy(class_java_lang_Object);
-       //printRTClassHeirarchy(m->class);
+       /* printRTClassHeirarchy(m->class); */
        if (pClassHeirStatsOnly >= 2) {
                fflush(stdout);
                printf("--- end  of RT info ---------------\n");
index c4f2daba8858386ecb104a85f93139a7f2b8c860..6399a8fd3b1176f0f9e1d52a5d104393b628d695 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: jit.c 1478 2004-11-11 11:16:30Z twisti $
+   $Id: jit.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -1344,14 +1344,14 @@ static void* do_nothing_function()
 
 *******************************************************************************/
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
-                                                                       registerdata *rd, loopdata *ld,
-                                                                       t_inlining_globals *id);
+static functionptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                         registerdata *rd, loopdata *ld,
+                                                                         t_inlining_globals *id);
 
-methodptr jit_compile(methodinfo *m)
+functionptr jit_compile(methodinfo *m)
 {
        static bool jitrunning;
-       methodptr r;
+       functionptr r;
        s4 dumpsize;
        codegendata *cd;
        registerdata *rd;
@@ -1382,7 +1382,8 @@ methodptr jit_compile(methodinfo *m)
                if (compileverbose)
                        log_message_method("No code given for: ", m);
 
-               m->entrypoint = (methodptr) do_nothing_function;
+               /*m->entrypoint = (methodptr) do_nothing_function;*/
+               m->entrypoint = (functionptr) do_nothing_function;
 
                return m->entrypoint;    /* return empty method     */
        }
@@ -1417,8 +1418,8 @@ methodptr jit_compile(methodinfo *m)
 
        /* RTA static analysis must be called before inlining */
        if (opt_rt)
-               RT_jit_parse(m); // will be called just once
-                                /* return value ignored for now */
+               RT_jit_parse(m); /* will be called just once */
+                            /* return value ignored for now */
 
        /* must be called before reg_setup, because it can change maxlocals */
        /* init reqd to initialize for parse even in no inlining */
@@ -1485,9 +1486,9 @@ methodptr jit_compile(methodinfo *m)
 
 *******************************************************************************/
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
-                                                                       registerdata *rd, loopdata *ld,
-                                                                       t_inlining_globals *id)
+static functionptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                         registerdata *rd, loopdata *ld,
+                                                                         t_inlining_globals *id)
 {
        /* print log message for compiled method */
 
@@ -1616,7 +1617,7 @@ static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
                show_icmd_method(m, cd, rd);
 
        } else if (showdisassemble) {
-               disassemble((void *) (m->mcode + cd->dseglen), 
+               disassemble((void *) ((long) m->mcode + cd->dseglen), 
                                        m->mcodelength - cd->dseglen);
        }
 
index 2a8ddab4e6132c2ae93e2f7ffd788b904da82507..8c128be32b7b34654e3bed8f18c75d2c49b707f1 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: jit.h 1456 2004-11-05 14:33:14Z twisti $
+   $Id: jit.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -823,7 +823,7 @@ extern bool method_uses_edx;
 
 /* function prototypes */
 
-methodptr jit_compile(methodinfo *m);   /* compile a method with jit compiler */
+functionptr jit_compile(methodinfo *m); /* compile a method with jit compiler */
 
 void jit_init();                        /* compiler initialisation            */
 void jit_close();                       /* compiler finalisation              */
index 7802ac4d8fd6ee074cb14c9fa8ac78294431399e..530008a9154ad41eae8770fef65dfc9957b050ea 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Carolyn Oates
             Edwin Steiner
 
-   $Id: parse.c 1462 2004-11-06 15:08:49Z motse $
+   $Id: parse.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -79,7 +79,7 @@ bool DEBUG3 = false;
 bool DEBUG4 = false;  /*opcodes*/
 
 /*INLINING*/
-#define debug_writebranch if (DEBUG2==true) printf("op:: %s i: %d label_index[i]: %d label_index=%p\n",opcode_names[opcode], i, label_index[i],label_index);
+#define debug_writebranch if (DEBUG2==true) printf("op:: %s i: %d label_index[i]: %d label_index=0x%x\n",opcode_names[opcode], i, label_index[i], label_index);
 #define debug_writebranch1
 
 
@@ -365,12 +365,13 @@ static exceptiontable* fillextable(methodinfo *m,
        
        if (exceptiontablelength == 0) 
                return extable;
+
        
-//if (m->exceptiontablelength > 0) {
-//   DEBUGMETH(m);
-//   printf("m->exceptiontablelength=%i\n",m->exceptiontablelength);
-//   panic("exceptiontablelength > 0");
-//   }
+       /*if (m->exceptiontablelength > 0) {
+         DEBUGMETH(m);
+         printf("m->exceptiontablelength=%i\n",m->exceptiontablelength);
+         panic("exceptiontablelength > 0");
+         }*/
 
        b_count = *block_count;
 
@@ -384,7 +385,7 @@ static exceptiontable* fillextable(methodinfo *m,
                
 /*** if (DEBUG==true){printf("---------------------block_inserted:b_count=%i m->basicblockindex[(p=%i)]=%i=%p\n",b_count,p,m->basicblockindex[(p)],m->basicblockindex[(p)]); 
   fflush(stdout); } ***/   
-               p = raw_extable[i].endpc; // see JVM Spec 4.7.3
+               p = raw_extable[i].endpc; /* see JVM Spec 4.7.3 */
                if (p < raw_extable[i].startpc)
                        panic("Invalid exception handler range");
                if (p > m->jcodelength) { 
@@ -509,17 +510,20 @@ if (opt_rt) {
        memset(iptr, 0, sizeof(instruction) * (inline_env->cumjcodelength + 5));
        
        /* compute branch targets of exception table */
-//if (m->exceptiontable == NULL) {
-//  printf("m->exceptiontable=NULL\n");fflush(stdout);
-//  }
-//else {
-//  printf("m->exceptiontable != NULL\n");fflush(stdout);
-//  }
-//printf("m->exceptiontablelength=%i, inline_env->method->exceptiontablelength=%i,inline_env->cumextablelength=%i\n",
-//m->exceptiontablelength, inline_env->method->exceptiontablelength,inline_env->cumextablelength);
-
-//if (m->exceptiontablelength > 0)
-//     m->exceptiontable = DMNEW(exceptiontable, m->exceptiontablelength + 1); 
+       /*
+if (m->exceptiontable == NULL) {
+  printf("m->exceptiontable=NULL\n");fflush(stdout);
+  }
+else {
+  printf("m->exceptiontable != NULL\n");fflush(stdout);
+  }
+printf("m->exceptiontablelength=%i, inline_env->method->exceptiontablelength=%i,inline_env->cumextablelength=%i\n",
+m->exceptiontablelength, inline_env->method->exceptiontablelength,inline_env->cumextablelength);
+       */
+       /*
+if (m->exceptiontablelength > 0)
+       m->exceptiontable = DMNEW(exceptiontable, m->exceptiontablelength + 1); 
+       */
 
        nextex = fillextable(m, 
          cd->exceptiontable, m->exceptiontable, m->exceptiontablelength, 
@@ -570,7 +574,7 @@ if (opt_rt) {
                        bool *readonly = NULL;
                        int argBlockIdx=0;
 
-                       block_insert(gp);               //JJJJJJJJJJ
+                       block_insert(gp);               /* JJJJJJJJJJ */
                        blockend=false;
                        instructionstart[gp] = 1;
                        m->basicblockindex[gp] |= (ipc << 1);  /*FIXME: necessary ? */
@@ -614,8 +618,8 @@ if (opt_rt) {
                                        argBlockIdx--;
 
                                OP1(op, firstlocal + argBlockIdx);
-                               //OP1(op, firstlocal + tmpinlinf->method->paramcount - 1 - i);
-                       //printf("inline argument load operation for local: %ld\n",firstlocal + tmpinlinf->method->paramcount - 1 - i);
+                               /* OP1(op, firstlocal + tmpinlinf->method->paramcount - 1 - i); */
+                               /* printf("inline argument load operation for local: %ld\n",firstlocal + tmpinlinf->method->paramcount - 1 - i); */
                        }
                        skipBasicBlockChange=1;
 if (DEBUG==true) {
@@ -658,19 +662,22 @@ DEBUGMETH(inline_env->method);
                        printf("Parse p=%i<%i<%i<   opcode=<%i> %s\n",
                           p, gp, inline_env->jcodelength, opcode, opcode_names[opcode]);
                }
-         
-//printf("basicblockindex[gp=%i]=%i=%p ipc=%i=%p shifted ipc=%i=%p\n",
-//gp,m->basicblockindex[gp],m->basicblockindex[gp],ipc,ipc,(ipc<<1),(ipc<<1));
-//fflush(stdout);
+        /*
+printf("basicblockindex[gp=%i]=%i=%p ipc=%i=%p shifted ipc=%i=%p\n",
+gp,m->basicblockindex[gp],m->basicblockindex[gp],ipc,ipc,(ipc<<1),(ipc<<1));
+fflush(stdout);
+        */
                if (!skipBasicBlockChange) {
                        m->basicblockindex[gp] |= (ipc << 1); /*store intermed cnt*/
                } else skipBasicBlockChange=0;
-//printf("basicblockindex[gp=%i]=%i=%p \n",
-//gp,m->basicblockindex[gp],m->basicblockindex[gp]);
-//fflush(stdout);
+               /*
+printf("basicblockindex[gp=%i]=%i=%p \n",
+gp,m->basicblockindex[gp],m->basicblockindex[gp]);
+fflush(stdout);
+               */
 
                if (blockend) {
-//printf("B4 BEND\t"); fflush(stdout);
+                       /* printf("B4 BEND\t"); fflush(stdout); */
                        block_insert(gp);               /* start new block                */
                        blockend = false;
                        /*printf("blockend was set: new blockcount: %ld at:%ld\n",b_count,gp);*/
@@ -1010,7 +1017,7 @@ SHOWOPCODE
                                i = label_index[i];
                        }
                        bound_check(i);
-//printf("B6 JSR_W\t"); fflush(stdout);
+                       /*printf("B6 JSR_W\t"); fflush(stdout);*/
                        block_insert(i);
                        blockend = true;
                        OP1(opcode, i);
@@ -1047,12 +1054,13 @@ SHOWOPCODE
                                /*                                              break; */
                                /*                                      } */
                                if (nextp>inline_env->method->jcodelength-1) {
-                                  //OP1(ICMD_GOTO, inlinfo->stopgp);
-                                   //OP(ICMD_NOP);
-                                   //OP(ICMD_NOP);
-                                   blockend=true;
-                                   break;
-                                }//JJJJJJJ
+                                       /* OP1(ICMD_GOTO, inlinfo->stopgp);
+                                          OP(ICMD_NOP);
+                                          OP(ICMD_NOP);
+                                       */
+                                       blockend=true;
+                                       break;
+                               } /* JJJJJJJ */
                                blockend = true;
                                OP1(ICMD_GOTO, inlinfo->stopgp);
                                break;
@@ -1099,7 +1107,9 @@ SHOWOPCODE
                                tablep++;
                                nextp += 4;
                                bound_check(j);
-//printf("B7 LOOKUP1\t"); fflush(stdout);
+/*
+printf("B7 LOOKUP1\t"); fflush(stdout);
+*/
                                block_insert(j);
 
                                /* number of pairs */
@@ -1135,7 +1145,9 @@ SHOWOPCODE
                                        tablep++;
                                        nextp += 4;
                                        bound_check(j);
-//printf("B8 LOOKUP2\t"); fflush(stdout);
+/*
+printf("B8 LOOKUP2\t"); fflush(stdout);
+*/
                                        block_insert(j);
                                }
 
@@ -1171,7 +1183,9 @@ SHOWOPCODE
                                tablep++;
                                nextp += 4;
                                bound_check(j);
-//printf("B9 TABLESWITCH1\t"); fflush(stdout);
+/*
+printf("B9 TABLESWITCH1\t"); fflush(stdout);
+*/
                                block_insert(j);
 
                                /* lower bound */
@@ -1205,7 +1219,9 @@ SHOWOPCODE
                                        tablep++;
                                        nextp += 4;
                                        bound_check(j);
-//printf("B10 TABLESWITCH2\t"); fflush(stdout);
+/*
+printf("B10 TABLESWITCH2\t"); fflush(stdout);
+*/
                                        block_insert(j);
                                        /*printf("TABLESWITCH: block_insert(%ld)\n",j);*/
                                }
@@ -1307,7 +1323,7 @@ SHOWOPCODE
                                if (!mi)
                                        return NULL;
 
-                               /*RTAprint*/// if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt)
+                               /*RTAprint*/ /* if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt) */
 if (DEBUG4==true) 
                                        /*RTAprint*/    {printf(" method name =");
                                        /*RTAprint*/    utf_display(mi->class->name); printf(".");
@@ -1351,7 +1367,7 @@ if (DEBUG4==true)
                                if (!mi)
                                        return NULL;
 
-                               /*RTAprint*/ // if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt)
+                               /*RTAprint*/ /* if (((pOpcodes == 2) || (pOpcodes == 3)) && opt_rt) */
 if (DEBUG4==true)
                                        /*RTAprint*/    {printf(" method name =");
                                        method_display(mi);
@@ -1651,18 +1667,18 @@ if (DEBUG4==true)
                
                /* INLINING */
                  
-//             if (inline_env->isinlinedmethod && p == inline_env->method->jcodelength - 1) { /* end of an inlined method */
+               /* if (inline_env->isinlinedmethod && p == inline_env->method->jcodelength - 1) { */ /* end of an inlined method */
                if (inline_env->isinlinedmethod && (nextp >= inline_env->method->jcodelength) ) { /* end of an inlined method */
                        /*                printf("setting gp from %d to %d\n",gp, inlinfo->stopgp); */
                        gp = inlinfo->stopgp; 
                        inlining_restore_compiler_variables();
-//label_index = inlinfo->label_index;
+/*label_index = inlinfo->label_index;*/
 if (DEBUG==true) {
 printf("AFTER RESTORE : "); fflush(stdout);
 DEBUGMETH(inline_env->method);
 }
                        list_remove(inlinfo->inlinedmethods, list_first(inlinfo->inlinedmethods));
-                       if (inlinfo->inlinedmethods == NULL) { //JJJJ
+                       if (inlinfo->inlinedmethods == NULL) { /* JJJJ */
                                nextgp = -1;
                        } else {
                                tmpinlinf = list_first(inlinfo->inlinedmethods);
@@ -1726,7 +1742,7 @@ DEBUGMETH(inline_env->method);
                /* allocate blocks */
 
                for (p = 0; p < inline_env->cumjcodelength; p++) { 
-//             for (p = 0; p < m->jcodelength; p++) { 
+               /* for (p = 0; p < m->jcodelength; p++) { */
                        if (m->basicblockindex[p] & 1) {
                                /* check if this block starts at the beginning of an instruction */
                                if (!instructionstart[p]) {
index d5780f759a0149b8f0e69b5405a353afd96b524c..1e0cd4e1f5c7e3307ba36390eda2f4961e59a749 100644 (file)
@@ -27,7 +27,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: reg.h 1456 2004-11-05 14:33:14Z twisti $
+   $Id: reg.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
 #include "jit/jit.h"
 
 
-typedef struct registerdata registerdata;
+/************************* pseudo variable structure **************************/
+
 typedef struct varinfo varinfo;
+
+struct varinfo {
+       int type;                   /* basic type of variable                     */
+       int flags;                  /* flags (SAVED, INMEMORY)                    */
+       int regoff;                 /* register number or memory offset           */
+};
+
 typedef struct varinfo varinfo5[5];
 
-//struct t_inlining_globals;
 
+typedef struct registerdata registerdata;
 
 struct registerdata {
        varinfo5 *locals;
@@ -117,15 +125,6 @@ struct registerdata {
 };
 
 
-/************************* pseudo variable structure **************************/
-
-struct varinfo {
-       int type;                   /* basic type of variable                     */
-       int flags;                  /* flags (SAVED, INMEMORY)                    */
-       int regoff;                 /* register number or memory offset           */
-};
-
-
 /* function prototypes */
 
 void reg_init();
index fec9ba945c5efd9aa449188eb0e94607d466e54e..541c7fa40d0a1cb9a1eff6f0713f0a9d8368dfbd 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 1466 2004-11-08 11:24:50Z twisti $
+   $Id: codegen.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -123,7 +123,7 @@ void catch_NullPointerException(int sig, siginfo_t *siginfo, void *_p)
 /*     faultaddr = sigctx->sc_regs[(instr >> 16) & 0x1f]; */
 
 /*     if (faultaddr == 0) { */
-       act.sa_sigaction = (void *) catch_NullPointerException; /* reinstall handler */
+       act.sa_sigaction = (functionptr) catch_NullPointerException; /* reinstall handler */
        act.sa_flags = SA_SIGINFO;
        sigaction(sig, &act, NULL);
        
@@ -160,7 +160,7 @@ void catch_ArithmeticException(int sig, siginfo_t *siginfo, void *_p)
 
        /* Reset signal handler - necessary for SysV, does no harm for BSD */
 
-       act.sa_sigaction = (void *) catch_ArithmeticException; /* reinstall handler */
+       act.sa_sigaction = (functionptr) catch_ArithmeticException; /* reinstall handler */
        act.sa_flags = SA_SIGINFO;
        sigaction(sig, &act, NULL);
 
@@ -187,19 +187,19 @@ void init_exceptions(void)
 
        if (!checknull) {
 #if defined(SIGSEGV)
-               act.sa_sigaction = (void *) catch_NullPointerException;
+               act.sa_sigaction = (functionptr) catch_NullPointerException;
                act.sa_flags = SA_SIGINFO;
                sigaction(SIGSEGV, &act, NULL);
 #endif
 
 #if defined(SIGBUS)
-               act.sa_sigaction = (void *) catch_NullPointerException;
+               act.sa_sigaction = (functionptr) catch_NullPointerException;
                act.sa_flags = SA_SIGINFO;
                sigaction(SIGBUS, &act, NULL);
 #endif
        }
 
-       act.sa_sigaction = (void *) catch_ArithmeticException;
+       act.sa_sigaction = (functionptr) catch_ArithmeticException;
        act.sa_flags = SA_SIGINFO;
        sigaction(SIGFPE, &act, NULL);
 }
index f34206f4cc36ae6f4f354b0584972fb319e455f4..75b607b0d45c1c217fe2ef770cc454e988dc22af 100644 (file)
@@ -32,7 +32,7 @@
             Edwin Steiner
             Christian Thalinger
 
-   $Id: loader.c 1443 2004-11-05 13:53:13Z twisti $
+   $Id: loader.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -1900,12 +1900,13 @@ static bool class_loadcpool(classbuffer *cb, classinfo *c)
                                return false;
 
                        if (opt_verify &&
-                               !is_valid_utf(cb->pos + 1, cb->pos + 1 + length)) {
+                               !is_valid_utf((char *) (cb->pos + 1),
+                                                         (char *) (cb->pos + 1 + length))) {
                                dolog("Invalid UTF-8 string (constant pool index %d)",idx);
                                panic("Invalid UTF-8 string");
                        }
                        /* insert utf-string into the utf-symboltable */
-                       cpinfos[idx] = utf_new_intern(cb->pos + 1, length);
+                       cpinfos[idx] = utf_new_intern((char *) (cb->pos + 1), length);
 
                        /* skip bytes of the string (buffer size check above) */
                        skip_nbytes(cb, length);
@@ -2907,7 +2908,7 @@ static classinfo *class_link_intern(classinfo *c)
                                return NULL;
 
                if (super->flags & ACC_INTERFACE) {
-                       // java.lang.IncompatibleClassChangeError: class a has interface java.lang.Cloneable as super class
+                       /* java.lang.IncompatibleClassChangeError: class a has interface java.lang.Cloneable as super class */
                        panic("Interface specified as super class");
                }
 
@@ -2956,7 +2957,7 @@ static classinfo *class_link_intern(classinfo *c)
                                                        goto notfoundvftblindex;
 
                                                if (tc->methods[j].flags & ACC_FINAL) {
-                                                       // class a overrides final method .
+                                                       /* class a overrides final method . */
                                                        *exceptionptr =
                                                                new_exception(string_java_lang_VerifyError);
                                                        return NULL;
index ffea741a4c160dab5c0147d1e4a37a69e52ea80c..b52cf4853a7986c94245c44200ee42520308e066 100644 (file)
@@ -27,6 +27,7 @@
 #include <errno.h>
 
 #include "config.h"
+#include "exceptions.h"
 #include "thread.h"
 #include "locks.h"
 #include "tables.h"
index 1c1eee4c6cbaeb25c93cfa95d732bc6e5b3c5bb6..0a8d5b138f666ef66b16d30d2aba4de7f928dabd 100644 (file)
@@ -202,7 +202,7 @@ extern thread *threadQhead[MAX_THREAD_PRIO + 1];
 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
 u1*  asm_initialize_thread_stack(void *func, u1 *stack);
 
-#else // defined(NATIVE_THREADS)
+#else /* NATIVE_THREADS */
 #include "nativethread.h"
 #endif
 
index c6c1f07fd245bf4ae4e0b30fae24bb84072e39a6..8bb630e7c9394aeae0e984206c6dfcae69454f00 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: memory.c 1489 2004-11-12 11:31:47Z twisti $
+   $Id: memory.c 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -207,7 +207,7 @@ void *dump_alloc(int size)
                }
 
                /* allocate dumpblock memory */
-               //printf("new dumpblock: %d\n", newdumpblocksize);
+               /*printf("new dumpblock: %d\n", newdumpblocksize);*/
                newdumpblock->dumpmem = checked_alloc(newdumpblocksize);
 
                newdumpblock->prev = di->currentdumpblock;
@@ -216,7 +216,7 @@ void *dump_alloc(int size)
 
                /* Used dump size is previously allocated dump size, because the      */
                /* remaining free memory of the previous dump block cannot be used.   */
-               //printf("unused memory: %d\n", allocateddumpsize - useddumpsize);
+               /*printf("unused memory: %d\n", allocateddumpsize - useddumpsize);*/
                di->useddumpsize = di->allocateddumpsize;
 
                /* increase the allocated dump size by the size of the new dump block */
index 99ec0cec88078d17a58f9aebc30afdc64c097a0c..c87df8b271d06bb364923f23f3d1d093597465c8 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: memory.h 1437 2004-11-05 09:51:07Z twisti $
+   $Id: memory.h 1494 2004-11-12 13:34:26Z twisti $
 
 */
 
@@ -102,7 +102,7 @@ typedef struct dumpblock dumpblock;
 
 struct dumpblock {
        dumpblock *prev;
-       void      *dumpmem;
+       u1        *dumpmem;
        s4         size;
 };