* src/vm/jit/intrp/codegen.c (codegen): Convert JavaPCs to block indices.
authoredwin <none@none>
Wed, 4 Oct 2006 15:14:19 +0000 (15:14 +0000)
committeredwin <none@none>
Wed, 4 Oct 2006 15:14:19 +0000 (15:14 +0000)
Do not check for BBREACHED (not set by parse).
(gen_branch): Convert JavaPCs to block indices.

* src/vm/jit/intrp/java.vmg (RET): restored.

* src/vm/jit/jit.c (jit_compile_intern): Do not perform stack_analyse and
dependent passes for intrp.

src/vm/jit/intrp/codegen.c
src/vm/jit/intrp/java.vmg
src/vm/jit/jit.c

index 07ba1c849bc02325b9f32213648b9d4bfee609e0..c462594e8ba13acb7dbd3ce4f925719ca5d10a6a 100644 (file)
@@ -29,7 +29,7 @@
                        
    Changes: Edwin Steiner
 
-   $Id: codegen.c 5664 2006-10-04 14:31:01Z edwin $
+   $Id: codegen.c 5667 2006-10-04 15:14:19Z edwin $
 
 */
 
 #include "vm/jit/jit.h"
 #include "vm/jit/parse.h"
 #include "vm/jit/patcher.h"
+#include "vm/jit/stack.h"
 
 
 #define gen_branch(_inst) { \
   gen_##_inst(cd, 0); \
-  codegen_addreference(cd, iptr->dst.block); \
+  codegen_addreference(cd, BLOCK_OF(iptr->dst.insindex)); \
 }
 
 #define index2offset(_i) (-(_i) * SIZEOF_VOID_P)
@@ -372,7 +373,7 @@ bool intrp_codegen(jitdata *jd)
 
                bptr->mpc = (s4) (cd->mcodeptr - cd->mcodebase);
 
-               if (bptr->flags >= BBREACHED) {
+               if (bptr->flags != BBDELETED) {
 
                /* walk through all instructions */
                
@@ -1277,7 +1278,7 @@ bool intrp_codegen(jitdata *jd)
                                        /* op1 = target JavaVM pc                     */
 
                        gen_JSR(cd, NULL);
-                       codegen_addreference(cd, iptr->sx.s23.s3.jsrtarget.block);
+                       codegen_addreference(cd, BLOCK_OF(iptr->sx.s23.s3.jsrtarget.insindex));
                        break;
 
                case ICMD_RET:          /* ... ==> ...                                */
@@ -1572,14 +1573,14 @@ bool intrp_codegen(jitdata *jd)
                        dseg_adddata(cd);
                        cd->mcodeptr = (u1 *) cd->mcodeptr + 2 * sizeof(Inst);
 
-                       codegen_addreference(cd, table[0].block);
+                       codegen_addreference(cd, BLOCK_OF(table[0].insindex));
 
                        /* build jump table top down and use address of lowest entry */
 
                        table += i;
 
                        while (--i >= 0) {
-                               dseg_addtarget(cd, table->block); 
+                               dseg_addtarget(cd, BLOCK_OF(table->insindex)); 
                                --table;
                        }
                        }
@@ -1611,12 +1612,12 @@ bool intrp_codegen(jitdata *jd)
                        /* build jump table top down and use address of lowest entry */
 
                        while (--i >= 0) {
-                               dseg_addtarget(cd, lookup->target.block); 
+                               dseg_addtarget(cd, BLOCK_OF(lookup->target.insindex)); 
                                dseg_addaddress(cd, lookup->value);
                                lookup++;
                        }
 
-                       codegen_addreference(cd, iptr->sx.s23.s3.lookupdefault.block);
+                       codegen_addreference(cd, BLOCK_OF(iptr->sx.s23.s3.lookupdefault.insindex));
                        }
 
                        /* length of dataseg after last dseg_addtarget is used by load */
@@ -1755,7 +1756,7 @@ bool intrp_codegen(jitdata *jd)
 
        gen_BBEND;
 
-       } /* if (bptr->flags >= BBREACHED) */
+       } /* if (bptr->flags != BBDELETED) */
        } /* for basic block */
 
        dseg_createlinenumbertable(cd);
index 1e713eefd4a433cf70c14bdfd515956db94655d6..4f2ea7ba34eda921eccfecd7331070c02f16b792 100644 (file)
@@ -790,6 +790,13 @@ JSR (  #ainstTarget -- ainstRA ) 0xa8
   SET_IP(ainstTarget);
 }
 
+RET ( #vOffset -- ) 0xa9
+{
+  Inst * saved_ip;
+  saved_ip = access_local_ref(vOffset);
+  SET_IP(saved_ip);
+}
+
 TABLESWITCH ( #iLow #iRange #addrSegment #iOffset #ainstDefault iIndex -- ) 0xaa
 {
   s4 idx = iIndex - iLow;
index 82a37624684599d03adbf74561129b3afee9fcd7..8760d2328ef60b95ad1b3df41c554a4e384c0f1c 100644 (file)
@@ -31,7 +31,7 @@
             Christian Thalinger
             Christian Ullrich
 
-   $Id: jit.c 5656 2006-10-03 20:57:15Z edwin $
+   $Id: jit.c 5667 2006-10-04 15:14:19Z edwin $
 
 */
 
@@ -1592,69 +1592,69 @@ static u1 *jit_compile_intern(jitdata *jd)
 
        DEBUG_JIT_COMPILEVERBOSE("Parsing done: ");
        
-       DEBUG_JIT_COMPILEVERBOSE("Analysing: ");
+#if defined(ENABLE_JIT)
+# if defined(ENABLE_INTRP)
+       if (!opt_intrp) {
+# endif
+               DEBUG_JIT_COMPILEVERBOSE("Analysing: ");
 
-       /* call stack analysis pass */
+               /* call stack analysis pass */
 
-       if (!stack_analyse(jd)) {
-               DEBUG_JIT_COMPILEVERBOSE("Exception while analysing: ");
+               if (!stack_analyse(jd)) {
+                       DEBUG_JIT_COMPILEVERBOSE("Exception while analysing: ");
 
-               return NULL;
-       }
-       RT_TIMING_GET_TIME(time_stack);
+                       return NULL;
+               }
+               RT_TIMING_GET_TIME(time_stack);
 
-       DEBUG_JIT_COMPILEVERBOSE("Analysing done: ");
+               DEBUG_JIT_COMPILEVERBOSE("Analysing done: ");
 
-       /* Build the CFG.  This has to be done after stack_analyse, as
-          there happens the JSR elimination. */
+               /* Build the CFG.  This has to be done after stack_analyse, as
+                  there happens the JSR elimination. */
 
-       if (!cfg_build(jd))
-               return NULL;
+               if (!cfg_build(jd))
+                       return NULL;
 
 #ifdef ENABLE_VERIFIER
-       if (jd->flags & JITDATA_FLAG_VERIFY) {
-               DEBUG_JIT_COMPILEVERBOSE("Typechecking: ");
+               if (jd->flags & JITDATA_FLAG_VERIFY) {
+                       DEBUG_JIT_COMPILEVERBOSE("Typechecking: ");
 
-               /* call typecheck pass */
-               if (!typecheck(jd)) {
-                       DEBUG_JIT_COMPILEVERBOSE("Exception while typechecking: ");
+                       /* call typecheck pass */
+                       if (!typecheck(jd)) {
+                               DEBUG_JIT_COMPILEVERBOSE("Exception while typechecking: ");
 
-                       return NULL;
-               }
+                               return NULL;
+                       }
 
-               DEBUG_JIT_COMPILEVERBOSE("Typechecking done: ");
-       }
+                       DEBUG_JIT_COMPILEVERBOSE("Typechecking done: ");
+               }
 #endif
-       RT_TIMING_GET_TIME(time_typecheck);
+               RT_TIMING_GET_TIME(time_typecheck);
 
 #if defined(ENABLE_LOOP)
-       if (opt_loops) {
-               depthFirst(jd);
-               analyseGraph(jd);
-               optimize_loops(jd);
-       }
+               if (opt_loops) {
+                       depthFirst(jd);
+                       analyseGraph(jd);
+                       optimize_loops(jd);
+               }
 #endif
-       RT_TIMING_GET_TIME(time_loop);
+               RT_TIMING_GET_TIME(time_loop);
 
 #if defined(ENABLE_IFCONV)
-       if (JITDATA_HAS_FLAG_IFCONV(jd))
-               if (!ifconv_static(jd))
-                       return NULL;
+               if (JITDATA_HAS_FLAG_IFCONV(jd))
+                       if (!ifconv_static(jd))
+                               return NULL;
 #endif
-       RT_TIMING_GET_TIME(time_ifconv);
+               RT_TIMING_GET_TIME(time_ifconv);
 
-       /* Basic block reordering.  I think this should be done after
-          if-conversion, as we could lose the ability to do the
-          if-conversion. */
+               /* Basic block reordering.  I think this should be done after
+                  if-conversion, as we could lose the ability to do the
+                  if-conversion. */
 
-       if (JITDATA_HAS_FLAG_REORDER(jd))
-               if (!reorder(jd))
-                       return NULL;
+               if (JITDATA_HAS_FLAG_REORDER(jd))
+                       if (!reorder(jd))
+                               return NULL;
 
-#if defined(ENABLE_JIT)
-# if defined(ENABLE_INTRP)
-       if (!opt_intrp) {
-# endif
                DEBUG_JIT_COMPILEVERBOSE("Allocating registers: ");
 
 #if defined(ENABLE_LSRA) && !defined(ENABLE_SSA)