264 #ifndef PRODUCT
265 // Dump the IFG
266 void dump() const;
267 void stats() const;
268 void verify( const PhaseChaitin * ) const;
269 #endif
270
271 //--------------- Live Range Accessors
272 LRG &lrgs(uint idx) const { assert(idx < _maxlrg, "oob"); return _lrgs[idx]; }
273
274 // Compute and set effective degree. Might be folded into SquareUp().
275 void Compute_Effective_Degree();
276
277 // Compute effective degree as the sum of neighbors' _sizes.
278 int effective_degree( uint lidx ) const;
279 };
280
281 // The LiveRangeMap class is responsible for storing node to live range id mapping.
282 // Each node is mapped to a live range id (a virtual register). Nodes that are
283 // not considered for register allocation are given live range id 0.
284 class LiveRangeMap VALUE_OBJ_CLASS_SPEC {
285
286 private:
287
288 uint _max_lrg_id;
289
290 // Union-find map. Declared as a short for speed.
291 // Indexed by live-range number, it returns the compacted live-range number
292 LRG_List _uf_map;
293
294 // Map from Nodes to live ranges
295 LRG_List _names;
296
297 // Straight out of Tarjan's union-find algorithm
298 uint find_compress(const Node *node) {
299 uint lrg_id = find_compress(_names.at(node->_idx));
300 _names.at_put(node->_idx, lrg_id);
301 return lrg_id;
302 }
303
304 uint find_compress(uint lrg);
|
264 #ifndef PRODUCT
265 // Dump the IFG
266 void dump() const;
267 void stats() const;
268 void verify( const PhaseChaitin * ) const;
269 #endif
270
271 //--------------- Live Range Accessors
272 LRG &lrgs(uint idx) const { assert(idx < _maxlrg, "oob"); return _lrgs[idx]; }
273
274 // Compute and set effective degree. Might be folded into SquareUp().
275 void Compute_Effective_Degree();
276
277 // Compute effective degree as the sum of neighbors' _sizes.
278 int effective_degree( uint lidx ) const;
279 };
280
281 // The LiveRangeMap class is responsible for storing node to live range id mapping.
282 // Each node is mapped to a live range id (a virtual register). Nodes that are
283 // not considered for register allocation are given live range id 0.
284 class LiveRangeMap {
285
286 private:
287
288 uint _max_lrg_id;
289
290 // Union-find map. Declared as a short for speed.
291 // Indexed by live-range number, it returns the compacted live-range number
292 LRG_List _uf_map;
293
294 // Map from Nodes to live ranges
295 LRG_List _names;
296
297 // Straight out of Tarjan's union-find algorithm
298 uint find_compress(const Node *node) {
299 uint lrg_id = find_compress(_names.at(node->_idx));
300 _names.at_put(node->_idx, lrg_id);
301 return lrg_id;
302 }
303
304 uint find_compress(uint lrg);
|