170 // If _fat_proj is clear, live range requires num_regs() to be a power of
171 // 2, and it requires registers to form an aligned, adjacent set.
172 _fat_proj:1, //
173 _was_lo:1, // Was lo-degree prior to coalesce
174 _msize_valid:1, // _mask_size cache valid
175 _degree_valid:1, // _degree cache valid
176 _has_copy:1, // Adjacent to some copy instruction
177 _at_risk:1; // Simplify says this guy is at risk to spill
178
179
180 // Alive if non-zero, dead if zero
181 bool alive() const { return _def != NULL; }
182 bool is_multidef() const { return _def == NodeSentinel; }
183 bool is_singledef() const { return _def != NodeSentinel; }
184
185 #ifndef PRODUCT
186 void dump( ) const;
187 #endif
188 };
189
190 //------------------------------LRG_List---------------------------------------
191 // Map Node indices to Live RanGe indices.
192 // Array lookup in the optimized case.
193 class LRG_List : public ResourceObj {
194 friend class VMStructs;
195 uint _cnt, _max;
196 uint* _lidxs;
197 ReallocMark _nesting; // assertion check for reallocations
198 public:
199 LRG_List( uint max );
200
201 uint lookup( uint nidx ) const {
202 return _lidxs[nidx];
203 }
204 uint operator[] (uint nidx) const { return lookup(nidx); }
205
206 void map( uint nidx, uint lidx ) {
207 assert( nidx < _cnt, "oob" );
208 _lidxs[nidx] = lidx;
209 }
210 void extend( uint nidx, uint lidx );
211
212 uint Size() const { return _cnt; }
213 };
214
215 //------------------------------IFG--------------------------------------------
216 // InterFerence Graph
217 // An undirected graph implementation. Created with a fixed number of
218 // vertices. Edges can be added & tested. Vertices can be removed, then
219 // added back later with all edges intact. Can add edges between one vertex
220 // and a list of other vertices. Can union vertices (and their edges)
221 // together. The IFG needs to be really really fast, and also fairly
222 // abstract! It needs abstraction so I can fiddle with the implementation to
223 // get even more speed.
224 class PhaseIFG : public Phase {
225 friend class VMStructs;
226 // Current implementation: a triangular adjacency list.
227
228 // Array of adjacency-lists, indexed by live-range number
229 IndexSet *_adjs;
230
231 // Assertion bit for proper use of Squaring
232 bool _is_square;
233
234 // Live range structure goes here
|
170 // If _fat_proj is clear, live range requires num_regs() to be a power of
171 // 2, and it requires registers to form an aligned, adjacent set.
172 _fat_proj:1, //
173 _was_lo:1, // Was lo-degree prior to coalesce
174 _msize_valid:1, // _mask_size cache valid
175 _degree_valid:1, // _degree cache valid
176 _has_copy:1, // Adjacent to some copy instruction
177 _at_risk:1; // Simplify says this guy is at risk to spill
178
179
180 // Alive if non-zero, dead if zero
181 bool alive() const { return _def != NULL; }
182 bool is_multidef() const { return _def == NodeSentinel; }
183 bool is_singledef() const { return _def != NodeSentinel; }
184
185 #ifndef PRODUCT
186 void dump( ) const;
187 #endif
188 };
189
190 //------------------------------IFG--------------------------------------------
191 // InterFerence Graph
192 // An undirected graph implementation. Created with a fixed number of
193 // vertices. Edges can be added & tested. Vertices can be removed, then
194 // added back later with all edges intact. Can add edges between one vertex
195 // and a list of other vertices. Can union vertices (and their edges)
196 // together. The IFG needs to be really really fast, and also fairly
197 // abstract! It needs abstraction so I can fiddle with the implementation to
198 // get even more speed.
199 class PhaseIFG : public Phase {
200 friend class VMStructs;
201 // Current implementation: a triangular adjacency list.
202
203 // Array of adjacency-lists, indexed by live-range number
204 IndexSet *_adjs;
205
206 // Assertion bit for proper use of Squaring
207 bool _is_square;
208
209 // Live range structure goes here
|