* src/vm/jit/allocator/simplereg.c (reg_make_statistics): Make it
authoredwin <none@none>
Tue, 3 Oct 2006 18:09:26 +0000 (18:09 +0000)
committeredwin <none@none>
Tue, 3 Oct 2006 18:09:26 +0000 (18:09 +0000)
compile again.

src/vm/jit/allocator/simplereg.c

index 14fd26adf09c04a103653adbf14ae21fa3ec33ef..7992fa07386e09d1608bb42b608382481c5f4b21 100644 (file)
@@ -32,7 +32,7 @@
             Michael Starzinger
             Edwin Steiner
 
-   $Id: simplereg.c 5633 2006-10-02 13:59:13Z edwin $
+   $Id: simplereg.c 5647 2006-10-03 18:09:26Z edwin $
 
 */
 
@@ -1630,6 +1630,7 @@ void reg_make_statistics(jitdata *jd)
        basicblock  *bptr;
        int size_interface; /* == maximum size of in/out stack at basic block boundaries */
        bool in_register;
+       varinfo *var;
 
        /* get required compiler data */
 
@@ -1642,16 +1643,15 @@ void reg_make_statistics(jitdata *jd)
        size_interface = 0;
 
                /* count how many local variables are held in memory or register */
-               for(i=0; i < cd->maxlocals; i++)
-                       for (type=0; type <=4; type++)
-                               if (rd->locals[i][type].type != -1) { /* valid local */
-                                       if (rd->locals[i][type].flags & INMEMORY) {
-                                               count_locals_spilled++;
-                                               in_register=false;
-                                       }
-                                       else
-                                               count_locals_register++;
-                               }
+               for(i=0; i < jd->localcount; i++) {
+                       if (VAR(i)->flags & INMEMORY) {
+                               count_locals_spilled++;
+                               in_register=false;
+                       }
+                       else {
+                               count_locals_register++;
+                       }
+               }
 
                /* count how many stack slots are held in memory or register */
 
@@ -1664,56 +1664,33 @@ void reg_make_statistics(jitdata *jd)
                        if (!opt_lsra) {
 #endif 
                                /* check for memory moves from interface to BB instack */
-                               dst = bptr->instack;
                                len = bptr->indepth;
                                
                                if (len > size_interface) size_interface = len;
 
-                               while (dst != NULL) {
+                               while (len) {
                                        len--;
-                                       if (dst->varkind != STACKVAR) {
-                                               if ( (dst->flags & INMEMORY) ||
-                                                        (rd->interfaces[len][dst->type].flags & INMEMORY) || 
-                                                        ( (dst->flags & INMEMORY) && 
-                                                          (rd->interfaces[len][dst->type].flags & INMEMORY) && 
-                                                          (dst->vv.regoff != rd->interfaces[len][dst->type].regoff) ))
-                                               {
-                                                       /* one in memory or both inmemory at different offsets */
-                                                       count_mem_move_bb++;
-                                                       in_register=false;
-                                               }
-                                       }
+                                       var = VAR(bptr->invars[len]);
 
-                                       dst = dst->prev;
+                                       /* invars statistics (currently none) */
                                }
 
                                /* check for memory moves from BB outstack to interface */
-                               dst = bptr->outstack;
                                len = bptr->outdepth;
                                if (len > size_interface) size_interface = len;
 
-                               while (dst) {
+                               while (len) {
                                        len--;
-                                       if (dst->varkind != STACKVAR) {
-                                               if ( (dst->flags & INMEMORY) || \
-                                                        (rd->interfaces[len][dst->type].flags & INMEMORY) || \
-                                                        ( (dst->flags & INMEMORY) && \
-                                                          (rd->interfaces[len][dst->type].flags & INMEMORY) && \
-                                                          (dst->vv.regoff != rd->interfaces[len][dst->type].regoff) ))
-                                               {
-                                                       /* one in memory or both inmemory at different offsets */
-                                                       count_mem_move_bb++;
-                                                       in_register=false;
-                                               }
-                                       }
+                                       var = VAR(bptr->invars[len]);
 
-                                       dst = dst->prev;
+                                       /* outvars statistics (currently none) */
                                }
 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
                        }
 #endif 
 
 
+#if 0
                                dst = bptr->instack;
                                iptr = bptr->iinstr;
                                len = bptr->icount;
@@ -1771,10 +1748,12 @@ void reg_make_statistics(jitdata *jd)
                                        
                                        iptr++;
                                } /* while instructions */
+#endif
                        } /* if */
 
                        bptr = bptr->next;
                } /* while blocks */
+
                count_interface_size += size_interface; /* accummulate the size of the interface (between bb boundaries) */
                if (in_register) count_method_in_register++;
                if (in_register) {