src/share/vm/opto/live.hpp

Print this page
rev 4266 : 8009721: Make PhaseLive independent from regalloc
Summary: Moved class definition of LRG_List from chaitin.hpp to live.hpp
Reviewed-by:
Contributed-by: niclas.adlertz@oracle.com


  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_LIVE_HPP
  26 #define SHARE_VM_OPTO_LIVE_HPP
  27 
  28 #include "libadt/port.hpp"
  29 #include "libadt/vectset.hpp"
  30 #include "opto/block.hpp"
  31 #include "opto/indexSet.hpp"
  32 #include "opto/phase.hpp"
  33 #include "opto/regmask.hpp"
  34 
  35 class Block;
  36 class LRG_List;
  37 class PhaseCFG;
  38 class VectorSet;
  39 class IndexSet;

























  40 
  41 //------------------------------PhaseLive--------------------------------------
  42 // Compute live-in/live-out
  43 class PhaseLive : public Phase {
  44   // Array of Sets of values live at the start of a block.
  45   // Indexed by block pre-order number.
  46   IndexSet *_live;
  47 
  48   // Array of Sets of values defined locally in the block
  49   // Indexed by block pre-order number.
  50   IndexSet *_defs;
  51 
  52   // Array of delta-set pointers, indexed by block pre-order number
  53   IndexSet **_deltas;
  54   IndexSet *_free_IndexSet;     // Free list of same
  55 
  56   Block_List *_worklist;        // Worklist for iterative solution
  57 
  58   const PhaseCFG &_cfg;         // Basic blocks
  59   LRG_List &_names;             // Mapping from Nodes to live ranges




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_LIVE_HPP
  26 #define SHARE_VM_OPTO_LIVE_HPP
  27 
  28 #include "libadt/port.hpp"
  29 #include "libadt/vectset.hpp"
  30 #include "opto/block.hpp"
  31 #include "opto/indexSet.hpp"
  32 #include "opto/phase.hpp"
  33 #include "opto/regmask.hpp"
  34 
  35 class Block;

  36 class PhaseCFG;
  37 class VectorSet;
  38 class IndexSet;
  39 
  40 //------------------------------LRG_List---------------------------------------
  41 // Map Node indices to Live RanGe indices.
  42 // Array lookup in the optimized case.
  43 class LRG_List : public ResourceObj {
  44   friend class VMStructs;
  45   uint _cnt, _max;
  46   uint* _lidxs;
  47   ReallocMark _nesting;         // assertion check for reallocations
  48 public:
  49   LRG_List( uint max );
  50 
  51   uint lookup( uint nidx ) const {
  52     return _lidxs[nidx];
  53   }
  54   uint operator[] (uint nidx) const { return lookup(nidx); }
  55 
  56   void map( uint nidx, uint lidx ) {
  57     assert( nidx < _cnt, "oob" );
  58     _lidxs[nidx] = lidx;
  59   }
  60   void extend( uint nidx, uint lidx );
  61 
  62   uint Size() const { return _cnt; }
  63 };
  64 
  65 //------------------------------PhaseLive--------------------------------------
  66 // Compute live-in/live-out
  67 class PhaseLive : public Phase {
  68   // Array of Sets of values live at the start of a block.
  69   // Indexed by block pre-order number.
  70   IndexSet *_live;
  71 
  72   // Array of Sets of values defined locally in the block
  73   // Indexed by block pre-order number.
  74   IndexSet *_defs;
  75 
  76   // Array of delta-set pointers, indexed by block pre-order number
  77   IndexSet **_deltas;
  78   IndexSet *_free_IndexSet;     // Free list of same
  79 
  80   Block_List *_worklist;        // Worklist for iterative solution
  81 
  82   const PhaseCFG &_cfg;         // Basic blocks
  83   LRG_List &_names;             // Mapping from Nodes to live ranges