* Removed all Id tags.
[cacao.git] / src / vm / jit / optimizing / lsra.h
index b7f6f79620418f065454fbbcc8a30c950a9d454d..98f9b9a7de19e6258f98db0352727d3b996df6bd 100644 (file)
@@ -1,6 +1,6 @@
-/* src/vm/jit/lsra.h - linear scan register allocator header
+/* src/vm/jit/optimizing/lsra.h - linear scan register allocator header
 
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   Copyright (C) 2005, 2006 R. Grafl, A. Krall, C. Kruegel, C. Oates,
    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
    C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
    Institut f. Computersprachen - TU Wien
@@ -26,7 +26,6 @@
 
    Authors: Christian Ullrich
 
-   $Id: lsra.h,v 1.17 2005/11/22 14:36:16 christian Exp $
 
 */
 
@@ -36,6 +35,7 @@
 
 #include "toolbox/bitvector.h"
 
+
 #if !defined(NDEBUG)
 # include <assert.h>
 # define LSRA_DEBUG_CHECK
@@ -86,10 +86,10 @@ struct lifetime {
        int v_index;           /* local variable index or negative for stackslots */
        int type;                   /* TYPE_XXX or -1 for unused lifetime */
        long usagecount;            /* number of references*/
-       int reg;                    /* regoffset allocated by lsra*/
+       int regoff;                    /* regoffset allocated by lsra*/
        int savedvar;
        int flags;
-       struct stackslot *local_ss; /* Stackslots for this Lifetime or NULL ( ==  */
+       /* struct stackslot *local_ss; */ /* Stackslots for this Lifetime or NULL ( ==  */
                                 /* "pure" Local Var) */
        int bb_last_use;
        int i_last_use;
@@ -107,11 +107,13 @@ struct l_loop {
        int nesting;
 };
 
+/*
 struct stackslot {
        stackptr s;
        int bb;
        struct stackslot *next;
 };
+*/
 
 struct lsra_register {
        int *sav_reg;
@@ -149,6 +151,26 @@ struct igraph {
 
 
 struct lsradata {
+       /* int *var; */           /* unused entries are set to UNUSED    */
+                           /* maps to jd->vars array */
+       int varcount;       /* size of vars array */
+       int ssavarcount;    /* ls->vars[0..ssavarcount[ are all locals and iovars */
+                           /* they are regarded for ssa renaming */
+                           /* the rest (ls->vars[ssavarcount..varcount[ are      */
+                           /* TEMP or PREALLOC vars with just on definition and  */
+                           /* use within one basicblock -> not of interest for   */
+                           /* ssa renaming procedures */
+       int vartop;         /* next free var */
+       int varcount_with_indices;
+       int *new_varindex;  /* new_varindex[0..jd->varcount[ points to the new    */
+                           /* unique index of ls->vars(maps jd->vars to ls->vars)*/
+
+       int *var_0;        /* [0..ls->varcount]  */
+                          /* var_0[a] with a in [0..ls->varcount[ holds the */
+                          /* index of La,0 */
+                          /* var_0[ls->varcount] holds the number of vars with */
+                          /*indices */
+
        int *sorted;         /* BB sorted in reverse post order */
        int *sorted_rev;     /* BB reverse lookup of sorted */
 
@@ -157,9 +179,6 @@ struct lsradata {
 
        long *nesting;    /* Nesting level of BB*/
 
-       int maxlifetimes; /* copy from methodinfo to prevent passing methodinfo   */
-                      /* as parameter */
-
        struct lifetime *lifetime; /* array of lifetimes */
        int lifetimecount;         /* number of lifetimes */
        int *lt_used;              /* index to lifetimearray for used lifetimes   */
@@ -180,18 +199,18 @@ struct lsradata {
 
        /* SSA fields */
        bitvector *var_def; /* LocalVar Definition Bitvector [0..ls->bbcount]  */
-                      /* Bitvector holds ls->max_vars Bits              */
+                           /* Bitvector holds ls->max_vars Bits               */
        bitvector *use_sites; /* LocalVar Use Bitvector[0..ls->maxvars] */
        int **num_var_use; /* count of var_use[bb][var_index] */
        int **var; /* [0..cd->maxlocal+cd->maxstack[[0..4] */
        /* ssa_set_local_def and ssa_set_interface (called from analyse_stack)    */
-       /* set var[local_index][local_type] and var[cd->maxlocals+stack_depth]    */
+       /* set var[local_index][local_type] and var[jd->maxlocals+stack_depth]    */
        /* [stack_type] to a unique type independend index [0..ls->max_vars[      */
        /* unused entries are set to -1                                           */
        int max_vars;
        int max_vars_with_indices;
        int *num_defs;    /* counts definitions of variables     */
-                         /* [0..cd->maxlocals*5+cd->maxstack*5[ */
+                         /* [0..jd->maxlocals*5+cd->maxstack*5[ */
                          /* valid for [0..ls->max_vars[         */
        
 
@@ -203,7 +222,7 @@ struct lsradata {
        int *interface_0; /* same here, just with interfaces */
 
        int *var_to_index; /* var index to interface (<0) or local (>=0) index */
-                          /* [0..cd->maxlocals*5+cd->maxstack*5[              */
+                          /* [0..jd->maxlocals*5+cd->maxstack*5[              */
                           /* valid for [0..ls->max_vars[                      */
                           /* holds var_index or the negative interface index  */
                           /* in ssa_Rename_init the indices are changed to the */