Merged revisions 7616-7627 via svnmerge from
authormichi <none@none>
Mon, 2 Apr 2007 19:09:52 +0000 (19:09 +0000)
committermichi <none@none>
Mon, 2 Apr 2007 19:09:52 +0000 (19:09 +0000)
svn+ssh://michi@c1.complang.tuwien.ac.at/ahome/cacao/svn/cacao/trunk

........
  r7617 | twisti | 2007-03-30 01:22:07 +0200 (Fri, 30 Mar 2007) | 3 lines

  * src/vm/jit/powerpc/linux/md-os.c (md_signal_handler_sigsegv): Fixed
  address check (thanks Michi).
........
  r7619 | twisti | 2007-03-30 13:41:27 +0200 (Fri, 30 Mar 2007) | 9 lines

  * src/vm/jit/parse.c (parse_realloc_instructions): Renamed ipc to
  icount.
  (parse): Renamed ipc to icount, set method variables at the very end
  and use local variables before.

  * src/vm/jit/parse.h (INSTRUCTIONS_CHECK): Renamed ipc to icount.
  (PINC): Likewise.
  (OP_PREPARE_FLAGS): Likewise.
........
  r7620 | edwin | 2007-04-01 12:50:39 +0200 (Sun, 01 Apr 2007) | 3 lines

  * contrib/vmlog: Committed vmlog 0.0.5.
  * THIRDPARTY: Added copyright notice for vmlog.
........
  r7621 | stefan | 2007-04-01 18:18:16 +0200 (Sun, 01 Apr 2007) | 3 lines

  * src/vm/jit/powerpc/darwin/md-asm.h,
  src/vm/jit/i386/darwin/md-asm.h: added missing symbol asm_vm_call_method_end.
........
  r7622 | ajordan | 2007-04-02 00:53:59 +0200 (Mon, 02 Apr 2007) | 3 lines

  * src/vm/jit/sparc64/codegen.c: Implemented float argument passing for builtin calls.
  * src/vm/jit/sparc64/codegen.h: Likewise.
........
  r7623 | twisti | 2007-04-02 15:45:30 +0200 (Mon, 02 Apr 2007) | 5 lines

  * src/vm/jit/stack.c (stack_mark_reached): Added assert on b.
  (stack_mark_reached_from_outvars): Likewise.
  (stack_reach_next_block): Use NULL instead of !.
  (stack_analyse): Indent.
........
  r7624 | twisti | 2007-04-02 18:09:44 +0200 (Mon, 02 Apr 2007) | 3 lines

  * src/vm/jit/stack.c (stack_reach_next_block): Reformatted comments.
  (stack_analyse): Likewise.
........
  r7627 | twisti | 2007-04-02 20:56:59 +0200 (Mon, 02 Apr 2007) | 8 lines

  * src/vm/jit/jit.h (INS_FLAG_BASICBLOCK): Defined.
  (INS_FLAG_ID_SHIFT): Changed to 5.
  (INSTRUCTION_STARTS_BASICBLOCK): Added.

  * src/vm/jit/parse.c (parse): Changed basic block determination. Now
  basic blocks can start at IR instruction level. This is required for
  slow-fast path builtins.
........

--HG--
branch : exact-gc

THIRDPARTY
src/vm/jit/i386/darwin/md-asm.h
src/vm/jit/jit.h
src/vm/jit/parse.c
src/vm/jit/parse.h
src/vm/jit/powerpc/darwin/md-asm.h
src/vm/jit/powerpc/linux/md-os.c
src/vm/jit/sparc64/codegen.c
src/vm/jit/sparc64/codegen.h
src/vm/jit/stack.c

index d1931e0420933c6b8e08fb36306289b845428a23..e63655fdeeceb552c91686c2aa85420d8bc9930f 100644 (file)
@@ -197,3 +197,16 @@ notice and this notice are preserved.
    IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
    IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+* contrib/vmlog
+
+Copyright (C) 2006 Edwin Steiner <edwin.steiner@gmx.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+See contrib/vmlog/COPYING for the full text of the license.
+
index b936705618b194acc25d96e065a632a48b7c47ec..f54b9af063a3cc48979c6474057b49d734182c23 100644 (file)
@@ -85,6 +85,7 @@
 #define asm_vm_call_method_long               _asm_vm_call_method_long
 #define asm_vm_call_method_float              _asm_vm_call_method_float
 #define asm_vm_call_method_double             _asm_vm_call_method_double
+#define asm_vm_call_method_end                _asm_vm_call_method_end
 
 #define asm_vm_call_method_exception_handler  _asm_vm_call_method_exception_handler
 
index fe5d3949c51a2d7922bc564c37f6e5bb57b3cb25..98d823bbd53371d0d403160a9ab292d6b58ba69a 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jit.h 7596 2007-03-28 21:05:53Z twisti $
+   $Id: jit.h 7627 2007-04-02 18:56:59Z twisti $
 
 */
 
@@ -333,16 +333,17 @@ typedef union {
 
 /*** flags (32 bits) ***/
 
-#define INS_FLAG_UNRESOLVED    0x01    /* contains unresolved field/meth/class*/
-#define INS_FLAG_CLASS         0x02    /* for ACONST, PUT*CONST with class    */
-#define INS_FLAG_ARRAY         0x04    /* for CHECKCAST/INSTANCEOF with array */
-#define INS_FLAG_CHECK         0x08    /* for *ALOAD|*ASTORE: check index     */
+#define INS_FLAG_BASICBLOCK    0x01    /* marks a basic block start           */
+#define INS_FLAG_UNRESOLVED    0x02    /* contains unresolved field/meth/class*/
+#define INS_FLAG_CLASS         0x04    /* for ACONST, PUT*CONST with class    */
+#define INS_FLAG_ARRAY         0x08    /* for CHECKCAST/INSTANCEOF with array */
+#define INS_FLAG_CHECK         0x10    /* for *ALOAD|*ASTORE: check index     */
                                        /* for BUILTIN: check exception        */
-#define INS_FLAG_KILL_PREV     0x02    /* for *STORE, invalidate prev local   */
-#define INS_FLAG_KILL_NEXT     0x04    /* for *STORE, invalidate next local   */
-#define INS_FLAG_RETADDR       0x08    /* for ASTORE: op is a returnAddress   */
+#define INS_FLAG_KILL_PREV     0x04    /* for *STORE, invalidate prev local   */
+#define INS_FLAG_KILL_NEXT     0x08    /* for *STORE, invalidate next local   */
+#define INS_FLAG_RETADDR       0x10    /* for ASTORE: op is a returnAddress   */
 
-#define INS_FLAG_ID_SHIFT      4
+#define INS_FLAG_ID_SHIFT      5
 #define INS_FLAG_ID_MASK       (~0 << INS_FLAG_ID_SHIFT)
 
 typedef union {
@@ -374,6 +375,9 @@ struct instruction {
 };
 
 
+#define INSTRUCTION_STARTS_BASICBLOCK(iptr) \
+       ((iptr)->flags.bits & INS_FLAG_BASICBLOCK)
+
 #define INSTRUCTION_IS_RESOLVED(iptr) \
        (!((iptr)->flags.bits & INS_FLAG_UNRESOLVED))
 
index a8fcaee8785e9e965bbd5649adacaac72ad3eaa4..10e020b070c0c245c452d6700bca904c5a03ff02 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: parse.c 7601 2007-03-28 23:02:50Z michi $
+   $Id: parse.c 7627 2007-04-02 18:56:59Z twisti $
 
 */
 
@@ -129,7 +129,7 @@ static void parse_setup(jitdata *jd, parsedata_t *pd)
 
 *******************************************************************************/
 
-static instruction *parse_realloc_instructions(parsedata_t *pd, s4 ipc, s4 n)
+static instruction *parse_realloc_instructions(parsedata_t *pd, s4 icount, s4 n)
 {
        /* increase the size of the instruction array */
 
@@ -137,13 +137,14 @@ static instruction *parse_realloc_instructions(parsedata_t *pd, s4 ipc, s4 n)
 
        /* reallocate the array */
 
-       pd->instructions = DMREALLOC(pd->instructions, instruction, ipc,
+       pd->instructions = DMREALLOC(pd->instructions, instruction, icount,
                                                                 pd->instructionslength);
-       MZERO(pd->instructions + ipc, instruction, (pd->instructionslength - ipc));
+       MZERO(pd->instructions + icount, instruction,
+                 (pd->instructionslength - icount));
 
        /* return the iptr */
 
-       return pd->instructions + ipc;
+       return pd->instructions + icount;
 }
 
 
@@ -337,7 +338,7 @@ bool parse(jitdata *jd)
        methodinfo  *m;                     /* method being parsed                */
        parsedata_t  pd;
        instruction *iptr;                  /* current ptr into instruction array */
-       s4           ipc;                   /* intermediate instruction counter   */
+       s4           icount;                /* intermediate instruction counter   */
        s4           p;                     /* java instruction counter           */
        s4           nextp;                 /* start of next java instruction     */
        s4           opcode;                /* java opcode                        */
@@ -383,8 +384,8 @@ bool parse(jitdata *jd)
   
        /* initialize local variables */
   
-       iptr = pd.instructions;
-       ipc  = 0;
+       iptr   = pd.instructions;
+       icount = 0;
   
        /* mark basic block boundaries for exception table */
 
@@ -458,7 +459,7 @@ fetch_opcode:
 
                /* store intermediate instruction count (bit 0 mark block starts) */
 
-               jd->basicblockindex[p] |= (ipc << 1);
+               jd->basicblockindex[p] |= (icount << 1);
 
                /* compute next instruction start */
 
@@ -1515,7 +1516,7 @@ invoke_method:
                case 254:
                case 255:
                        exceptions_throw_verifyerror(m, "Illegal opcode %d at instr %d\n",
-                                                                                opcode, ipc);
+                                                                                opcode, icount);
                        return false;
                        break;
 #endif /* defined(ENABLE_VERIFIER) */
@@ -1553,8 +1554,8 @@ invoke_method:
 
        /* assert that we did not write more ICMDs than allocated */
 
-       assert(ipc <= pd.instructionslength);
-       assert(ipc == (iptr - pd.instructions));
+       assert(icount <= pd.instructionslength);
+       assert(icount == (iptr - pd.instructions));
 
        /*** verifier checks ******************************************************/
 
@@ -1573,73 +1574,105 @@ invoke_method:
 
        /*** setup the methodinfo, allocate stack and basic blocks ****************/
 
-       /* adjust block count if target 0 is not first intermediate instruction */
+       /* identify basic blocks */
 
-       if (!jd->basicblockindex[0] || (jd->basicblockindex[0] > 1))
-               b_count++;
-       else
-               jd->branchtoentry = true;
-
-       /* copy local to method variables */
+       /* First instruction always starts a basic block, but check if it
+          is already a branch target. */
 
-       jd->instructions = pd.instructions;
-       jd->instructioncount = ipc;
-       jd->basicblockcount = b_count;
-       jd->stackcount = s_count + jd->basicblockcount * m->maxstack; /* in-stacks */
+       if ((jd->basicblockindex[0] == 0) || (jd->basicblockindex[0] > 1)) {
+               iptr = pd.instructions;
 
-       /* allocate stack table */
+               iptr->flags.bits |= INS_FLAG_BASICBLOCK;
 
-       jd->stack = DMNEW(stackelement, jd->stackcount);
+               /* This is the first basic block. */
 
-       /* build basic block list */
-
-       bptr = jd->basicblocks = DMNEW(basicblock, b_count + 1);    /* one more for end ipc */
-
-       /* zero out all basic block structures */
-
-       MZERO(bptr, basicblock, b_count + 1);
-
-       b_count = 0;
-
-       /* additional block if target 0 is not first intermediate instruction */
-
-       if (!jd->basicblockindex[0] || (jd->basicblockindex[0] > 1)) {
-               BASICBLOCK_INIT(bptr, m);
+               b_count = 1;
+       }
+       else {
+               jd->branchtoentry = true;
 
-               bptr->iinstr = jd->instructions;
-               /* bptr->icount is set when the next block is allocated */
+               /* In this case the loop below counts the first basic
+                  block. */
 
-               bptr->nr = b_count++;
-               bptr++;
-               bptr[-1].next = bptr;
+               b_count = 0;
        }
 
-       /* allocate blocks */
+       /* Iterate over all bytecode instructions and mark the
+          corresponding IR instruction as basic block starting
+          instruction. */
 
-       for (p = 0; p < m->jcodelength; p++) {
-               if (jd->basicblockindex[p] & 1) {
+       for (i = 0; i < m->jcodelength; i++) {
+               if (jd->basicblockindex[i] & 0x1) {
 #if defined(ENABLE_VERIFIER)
                        /* Check if this block starts at the beginning of an
                           instruction. */
 
-                       if (!pd.instructionstart[p]) {
+                       if (pd.instructionstart[i] == 0) {
                                exceptions_throw_verifyerror(m,
                                                "Branch into middle of instruction");
                                return false;
                        }
 #endif
 
-                       /* allocate the block */
+                       /* Mark the IR instruction as basic block starting
+                          instruction. */
+
+                       iptr = pd.instructions + (jd->basicblockindex[i] >> 1);
+
+                       iptr->flags.bits |= INS_FLAG_BASICBLOCK;
+
+                       /* Store te basic block number in the array.  We need this
+                          information during stack analysis. */
+
+                       jd->basicblockindex[i] = b_count;
+
+                       /* basic block indices of course start with 0 */
+
+                       b_count++;
+               }
+       }
+
+       /* Iterate over all IR instructions and count the basic blocks. */
+
+       iptr = pd.instructions;
+
+       b_count = 0;
+
+       for (i = 0; i < icount; i++, iptr++) {
+               if (INSTRUCTION_STARTS_BASICBLOCK(iptr)) {
+                       b_count++;
+               }
+       }
+
+       /* Allocate basic block array (one more for end ipc). */
+
+       jd->basicblocks = DMNEW(basicblock, b_count + 1);
+
+       /* zero out all basic block structures */
+
+       MZERO(jd->basicblocks, basicblock, b_count + 1);
+
+       /* Now iterate again over all IR instructions and initialize the
+          basic block structures. */
+
+       iptr = pd.instructions;
+       bptr = jd->basicblocks;
+
+       b_count = 0;
+
+       for (i = 0; i < icount; i++, iptr++) {
+               if (INSTRUCTION_STARTS_BASICBLOCK(iptr)) {
+                       /* intialize the basic block */
 
                        BASICBLOCK_INIT(bptr, m);
 
-                       bptr->iinstr = jd->instructions + (jd->basicblockindex[p] >> 1);
-                       if (b_count) {
+                       bptr->iinstr = iptr;
+
+                       if (b_count > 0) {
                                bptr[-1].icount = bptr->iinstr - bptr[-1].iinstr;
                        }
-                       /* bptr->icount is set when the next block is allocated */
 
-                       jd->basicblockindex[p] = b_count;
+                       /* bptr->icount is set when the next block is allocated */
 
                        bptr->nr = b_count++;
                        bptr++;
@@ -1649,14 +1682,15 @@ invoke_method:
 
        /* set instruction count of last real block */
 
-       if (b_count) {
-               bptr[-1].icount = (jd->instructions + jd->instructioncount) - bptr[-1].iinstr;
+       if (b_count > 0) {
+               bptr[-1].icount = (pd.instructions + icount) - bptr[-1].iinstr;
        }
 
        /* allocate additional block at end */
 
-       BASICBLOCK_INIT(bptr,m);
+       BASICBLOCK_INIT(bptr, m);
        bptr->nr = b_count;
+
        jd->basicblockindex[m->jcodelength] = b_count;
 
        /* set basicblock pointers in exception table */
@@ -1694,7 +1728,7 @@ invoke_method:
 
                jd->varcount = 
                          nlocals                                      /* local variables */
-                       + jd->basicblockcount * m->maxstack                 /* invars */
+                       + b_count * m->maxstack                                 /* invars */
                        + s_count;         /* variables created within blocks (non-invar) */
 
                /* reserve the first indices for local variables */
@@ -1725,6 +1759,17 @@ invoke_method:
                                VAR(*mapptr)->type = i%5;
        }
 
+       /* assign local variables to method variables */
+
+       jd->instructions     = pd.instructions;
+       jd->instructioncount = icount;
+       jd->basicblockcount  = b_count;
+       jd->stackcount       = s_count + b_count * m->maxstack; /* in-stacks */
+
+       /* allocate stack table */
+
+       jd->stack = DMNEW(stackelement, jd->stackcount);
+
        /* everything's ok */
 
        return true;
index 398bc59f947c9bc2d047bda0778f456ca96e4ae2..6e650317b82cd4eac1ae9d458703d188243f83dd 100644 (file)
@@ -27,7 +27,7 @@
    Author:  Christian Thalinger
             Edwin Steiner
 
-   $Id: parse.h 6162 2006-12-10 21:27:07Z twisti $
+   $Id: parse.h 7619 2007-03-30 11:41:27Z twisti $
 
 */
 
@@ -99,8 +99,8 @@
     } while (0)
 
 #define INSTRUCTIONS_CHECK(i)                                        \
-    if ((ipc + (i)) > pd.instructionslength)                         \
-        iptr = parse_realloc_instructions(&pd, ipc, (i))
+    if ((icount + (i)) > pd.instructionslength)                      \
+        iptr = parse_realloc_instructions(&pd, icount, (i))
 
 
 /* intermediate code generating macros ****************************************/
 /* afterwards.                                                                */
 
 #define PINC                                                         \
-    iptr++; ipc++
+    iptr++; icount++
 
 #define OP_PREPARE_FLAGS(o, f)                                       \
     iptr->opc                = (o);                                  \
     iptr->line               = currentline;                          \
-    iptr->flags.bits         = (f) | (ipc << INS_FLAG_ID_SHIFT);
+    iptr->flags.bits         = (f) | (icount << INS_FLAG_ID_SHIFT);
 
 #define OP_PREPARE_ZEROFLAGS(o)                                      \
     OP_PREPARE_FLAGS(o, 0)
index b84052ca07306f8bae8af830b7cdf0235abf4824..ea5f8b44d4a9fec0843fd7f1e07be2cfb4f9902e 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: md-asm.h 6182 2006-12-12 21:12:23Z twisti $
+   $Id: md-asm.h 7621 2007-04-01 16:18:16Z stefan $
 
 */
 
 #define asm_vm_call_method_long               _asm_vm_call_method_long
 #define asm_vm_call_method_float              _asm_vm_call_method_float
 #define asm_vm_call_method_double             _asm_vm_call_method_double
+#define asm_vm_call_method_end                _asm_vm_call_method_end
 
 #define asm_vm_call_method_exception_handler  _asm_vm_call_method_exception_handler
 
index 139a5e9c9ba3f099899ecd08b33ca8cad0d128e2..91ef7e03c595d2329c8a331875b42195d83b4d3e 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: md-os.c 7616 2007-03-29 23:21:50Z michi $
+   $Id: md-os.c 7617 2007-03-29 23:22:07Z twisti $
 
 */
 
@@ -106,11 +106,10 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
                   define is 0. */
 
                addr = _mc->gregs[s1];
+               type = EXCEPTION_HARDWARE_NULLPOINTER;
 
-               if (addr == 0)
+               if (addr != 0)
                        vm_abort("md_signal_handler_sigsegv: faulting address is not NULL: addr=%p", addr);
-
-               type = (s4) addr;
        }
 
        /* generate appropriate exception */
index 8006002b0b7a3498dbe57be0b7bb4248d676529b..a5d4732f1f4d32fd5011b9221cbec38743f37031 100644 (file)
@@ -2297,8 +2297,47 @@ nowperformreturn:
                        bte = iptr->sx.s23.s3.bte;
                        md = bte->md;
                        
-                       /* XXX: proper builtin calling and float args are so not implemented */
-                       assert(md->paramcount <= 5 && md->argfltreguse < 1);
+                       /* XXX: builtin calling with stack arguments not implemented */
+                       assert(md->paramcount <= 5 && md->argfltreguse <= 16);
+                       
+                       s3 = md->paramcount;
+
+                       MCODECHECK((s3 << 1) + 64);
+
+                       /* copy float arguments according to ABI convention */
+
+                       int num_fltregargs = 0;
+                       int fltregarg_inswap[16];
+
+                       for (s3 = s3 - 1; s3 >= 0; s3--) {
+                               var = VAR(iptr->sx.s23.s2.args[s3]);
+
+                               if (var->flags & PREALLOC)
+                                       continue;
+
+                               if (IS_FLT_DBL_TYPE(var->type)) {
+                                       if (!md->params[s3].inmemory) {
+                                               s1 = md->params[s3].regoff; /*native flt args use regoff directly*/
+                                               d = emit_load(jd, iptr, var, REG_FTMP1);
+                                               
+                                               M_DMOV(d, s1 + 16);
+                                               fltregarg_inswap[num_fltregargs] = s1;
+                                               num_fltregargs++;
+                                               /*printf("builtin: flt arg swap to %d\n", s1 + 16);*/
+                                       }
+                                       else {
+                                               assert(0);
+                                       }
+                               }
+                       }
+                       
+                       int i;
+                       /* move swapped float args to target regs */
+                       for (i = 0; i < num_fltregargs; i++) {
+                               s1 = fltregarg_inswap[i];
+                               M_DMOV(s1 + 16, s1);
+                               /*printf("builtin float arg to target reg: %d ==> %d\n", s1+16, s1);*/
+                       }
                        
                        goto gen_method;
 
@@ -2344,6 +2383,9 @@ gen_method:
                                        }
                                }
                                else {
+                                       if (iptr->opc == ICMD_BUILTIN)
+                                               continue;
+                                               
                                        if (!md->params[s3].inmemory) {
                                                s1 = rd->argfltregs[md->params[s3].regoff];
                                                d = emit_load(jd, iptr, var, s1);
@@ -2378,6 +2420,10 @@ gen_method:
                            M_LDA(REG_ZERO, REG_RA_CALLER, -disp + 8); 
 
                                emit_exception_check(cd, iptr);
+                               if (md->returntype.type == TYPE_FLT) {
+                                       /* special handling for float return value in %f0 */
+                                       M_FMOV_INTERN(0,1);
+                               }
                                break;
 
                        case ICMD_INVOKESPECIAL:
@@ -3069,7 +3115,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
                                        M_DMOV(s1, s2 + 16);
                                        fltregarg_inswap[num_fltregargs] = s2;
                                        num_fltregargs++;
-                                       printf("flt arg swap to %d\n", s2 + 16);
+                                       /*printf("flt arg swap to %d\n", s2 + 16);*/
 
                                } else {
                                        s2 = nmd->params[j].regoff;
@@ -3097,7 +3143,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        for (i = 0; i < num_fltregargs; i++) {
                s1 = fltregarg_inswap[i];
                M_DMOV(s1 + 16, s1);
-               printf("float arg to target reg: %d ==> %d\n", s1+16, s1);
+               /*printf("float arg to target reg: %d ==> %d\n", s1+16, s1);*/
        }
 
 
index 6edfa3b1bfffb625e44affa31b2689fe2d1d4337..3978324a55638fd08eb730c4bdbd373b21348a1f 100644 (file)
@@ -567,7 +567,9 @@ s4   get_lopart_disp(s4 disp);
 
 
 #define M_DMOV(rs,rd)           M_FOP3_DX(0x02,0x34,0x02,rd,-1,rs)      /* rd = rs */
-#define M_FMOV(rs,rd)           M_FOP3_FX(0x02,0x34,0x01,rd,-1,rs)  /* rd = rs */
+#define M_FMOV(rs,rd)           M_FOP3_FX(0x02,0x34,0x01,rd,-1,rs)      /* rd = rs */
+
+#define M_FMOV_INTERN(rs,rd)    M_FOP3(0x02,0x34,0x01,rd,-1,rs)         /* rd = rs */
 
 #define M_FNEG(rs,rd)                  M_FOP3_FX(0x02,0x34,0x05,rd,-1,rs)              /* rd = -rs     */
 #define M_DNEG(rs,rd)                  M_FOP3_DX(0x02,0x34,0x06,rd,-1,rs)      /* rd = -rs     */
index bf20f3887697f62f47f1d8f46ab713d302e1e214..05c12ea9ad15f21bc964a9160f7d1bf92e689d2f 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: stack.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: stack.c 7624 2007-04-02 16:09:44Z twisti $
 
 */
 
@@ -1116,10 +1116,14 @@ static stackptr stack_create_instack(stackdata_t *sd)
 
 static basicblock *stack_mark_reached(stackdata_t *sd, basicblock *b, stackptr curstack, int stackdepth) 
 {
+       assert(b != NULL);
+
 #if defined(STACK_VERBOSE)
        printf("stack_mark_reached(L%03d from L%03d)\n", b->nr, sd->bptr->nr);
 #endif
+
        /* mark targets of backward branches */
+
        if (b->nr <= sd->bptr->nr)
                b->bitflags |= BBFLAG_REPLACEMENT;
 
@@ -1162,10 +1166,14 @@ static basicblock *stack_mark_reached(stackdata_t *sd, basicblock *b, stackptr c
 
 static basicblock *stack_mark_reached_from_outvars(stackdata_t *sd, basicblock *b)
 {
+       assert(b != NULL);
+
 #if defined(STACK_VERBOSE)
        printf("stack_mark_reached_from_outvars(L%03d from L%03d)\n", b->nr, sd->bptr->nr);
 #endif
+
        /* mark targets of backward branches */
+
        if (b->nr <= sd->bptr->nr)
                b->bitflags |= BBFLAG_REPLACEMENT;
 
@@ -1192,9 +1200,10 @@ static basicblock *stack_mark_reached_from_outvars(stackdata_t *sd, basicblock *
 
 /* stack_reach_next_block ******************************************************
 
-   Mark the following block reached and propagate the outvars of the current block
-   and the current locals to it. This function specializes the target block, 
-   if necessary, and returns a pointer to the specialized target.
+   Mark the following block reached and propagate the outvars of the
+   current block and the current locals to it.  This function
+   specializes the target block, if necessary, and returns a pointer
+   to the specialized target.
 
    IN:
       sd...........stack analysis data
@@ -1212,7 +1221,8 @@ static bool stack_reach_next_block(stackdata_t *sd)
 
        tbptr = (sd->bptr->original) ? sd->bptr->original : sd->bptr;
        tbptr = stack_mark_reached_from_outvars(sd, tbptr->next);
-       if (!tbptr)
+
+       if (tbptr == NULL)
                return false;
 
        if (tbptr != sd->bptr->next) {
@@ -2153,11 +2163,12 @@ bool stack_analyse(jitdata *jd)
 
                /* initialize loop over basic blocks */
 
-               sd.bptr = jd->basicblocks;
+               sd.bptr       = jd->basicblocks;
                superblockend = true;
-               sd.repeat = false;
-               curstack = NULL; stackdepth = 0;
-               deadcode = true;
+               sd.repeat     = false;
+               curstack      = NULL;
+               stackdepth    = 0;
+               deadcode      = true;
 
                /* iterate over basic blocks *****************************************/
 
@@ -2171,16 +2182,20 @@ bool stack_analyse(jitdata *jd)
 
                        if (sd.bptr->flags == BBTYPECHECK_REACHED) {
                                /* re-analyse a block because its input changed */
+
                                deadcode = false;
+
                                if (!stack_reanalyse_block(&sd))
                                        return false;
+
                                superblockend = true; /* XXX */
                                continue;
                        }
 
                        if (superblockend && (sd.bptr->flags < BBREACHED)) {
-                               /* This block has not been reached so far, and we      */
-                               /* don't fall into it, so we'll have to iterate again. */
+                               /* This block has not been reached so far, and we
+                                  don't fall into it, so we'll have to iterate
+                                  again. */
 
                                sd.repeat = true;
                                continue;
@@ -2194,8 +2209,9 @@ bool stack_analyse(jitdata *jd)
                        }
 
                        if (sd.bptr->original && sd.bptr->original->flags < BBFINISHED) {
-                               /* This block is a clone and the original has not been */
-                               /* analysed, yet. Analyse it on the next iteration.    */
+                               /* This block is a clone and the original has not been
+                                  analysed, yet. Analyse it on the next
+                                  iteration. */
 
                                sd.repeat = true;
                                /* XXX superblockend? */