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
@@ -31,15 +31,39 @@
#include "opto/indexSet.hpp"
#include "opto/phase.hpp"
#include "opto/regmask.hpp"
class Block;
-class LRG_List;
class PhaseCFG;
class VectorSet;
class IndexSet;
+//------------------------------LRG_List---------------------------------------
+// Map Node indices to Live RanGe indices.
+// Array lookup in the optimized case.
+class LRG_List : public ResourceObj {
+ friend class VMStructs;
+ uint _cnt, _max;
+ uint* _lidxs;
+ ReallocMark _nesting; // assertion check for reallocations
+public:
+ LRG_List( uint max );
+
+ uint lookup( uint nidx ) const {
+ return _lidxs[nidx];
+ }
+ uint operator[] (uint nidx) const { return lookup(nidx); }
+
+ void map( uint nidx, uint lidx ) {
+ assert( nidx < _cnt, "oob" );
+ _lidxs[nidx] = lidx;
+ }
+ void extend( uint nidx, uint lidx );
+
+ uint Size() const { return _cnt; }
+};
+
//------------------------------PhaseLive--------------------------------------
// Compute live-in/live-out
class PhaseLive : public Phase {
// Array of Sets of values live at the start of a block.
// Indexed by block pre-order number.