29 #include "opto/block.hpp" 30 #include "opto/indexSet.hpp" 31 #include "opto/phase.hpp" 32 #include "opto/regmask.hpp" 33 34 class Block; 35 class PhaseCFG; 36 class VectorSet; 37 class IndexSet; 38 39 //------------------------------LRG_List--------------------------------------- 40 // Map Node indices to Live RanGe indices. 41 // Array lookup in the optimized case. 42 typedef GrowableArray<uint> LRG_List; 43 44 //------------------------------PhaseLive-------------------------------------- 45 // Compute live-in/live-out 46 class PhaseLive : public Phase { 47 // Array of Sets of values live at the start of a block. 48 // Indexed by block pre-order number. 49 IndexSet *_live; 50 51 // Array of Sets of values defined locally in the block 52 // Indexed by block pre-order number. 53 IndexSet *_defs; 54 55 // Array of delta-set pointers, indexed by block pre-order number 56 IndexSet **_deltas; 57 IndexSet *_free_IndexSet; // Free list of same 58 59 Block_List *_worklist; // Worklist for iterative solution 60 61 const PhaseCFG &_cfg; // Basic blocks 62 const LRG_List &_names; // Mapping from Nodes to live ranges 63 uint _maxlrg; // Largest live-range number 64 Arena *_arena; 65 66 IndexSet *getset( Block *p ); 67 IndexSet *getfreeset( ); 68 void freeset( const Block *p ); 69 void add_liveout( Block *p, uint r, VectorSet &first_pass ); 70 void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ); 71 72 public: 73 PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena); 74 ~PhaseLive() {} 75 // Compute liveness info 76 void compute(uint maxlrg); 77 // Reset arena storage 78 void reset() { _live = NULL; } 79 80 // Return the live-out set for this block 81 IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; } 82 83 #ifndef PRODUCT 84 void dump( const Block *b ) const; 85 void stats(uint iters) const; 86 #endif 87 }; 88 89 #endif // SHARE_VM_OPTO_LIVE_HPP | 29 #include "opto/block.hpp" 30 #include "opto/indexSet.hpp" 31 #include "opto/phase.hpp" 32 #include "opto/regmask.hpp" 33 34 class Block; 35 class PhaseCFG; 36 class VectorSet; 37 class IndexSet; 38 39 //------------------------------LRG_List--------------------------------------- 40 // Map Node indices to Live RanGe indices. 41 // Array lookup in the optimized case. 42 typedef GrowableArray<uint> LRG_List; 43 44 //------------------------------PhaseLive-------------------------------------- 45 // Compute live-in/live-out 46 class PhaseLive : public Phase { 47 // Array of Sets of values live at the start of a block. 48 // Indexed by block pre-order number. 49 IndexSet *_live; // live out 50 IndexSet *_livein; // live in 51 52 // Array of Sets of values defined locally in the block 53 // Indexed by block pre-order number. 54 IndexSet *_defs; 55 56 // Array of delta-set pointers, indexed by block pre-order number 57 IndexSet **_deltas; 58 IndexSet *_free_IndexSet; // Free list of same 59 60 Block_List *_worklist; // Worklist for iterative solution 61 62 const PhaseCFG &_cfg; // Basic blocks 63 const LRG_List &_names; // Mapping from Nodes to live ranges 64 uint _maxlrg; // Largest live-range number 65 Arena *_arena; 66 bool _keep_deltas; // Retain live in information 67 68 IndexSet *getset( Block *p ); 69 IndexSet *getfreeset( ); 70 void freeset( Block *p ); 71 void add_liveout( Block *p, uint r, VectorSet &first_pass ); 72 void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ); 73 void add_livein( Block *p, IndexSet *lo ); 74 75 public: 76 PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena, bool keep_deltas); 77 ~PhaseLive() {} 78 // Compute liveness info 79 void compute(uint maxlrg); 80 // Reset arena storage 81 void reset() { _live = NULL; } 82 83 // Return the live-out set for this block 84 IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; } 85 IndexSet *livein( const Block * b ) { return &_livein[b->_pre_order - 1]; } 86 87 #ifndef PRODUCT 88 void dump( const Block *b ) const; 89 void stats(uint iters) const; 90 #endif 91 }; 92 93 #endif // SHARE_VM_OPTO_LIVE_HPP |