src/share/vm/opto/ifg.cpp

changeset 5539
adb9a7d94cb5
parent 5509
d1034bd8cefc
child 5635
650868c062a9
     1.1 --- a/src/share/vm/opto/ifg.cpp	Thu Aug 15 11:59:19 2013 -0700
     1.2 +++ b/src/share/vm/opto/ifg.cpp	Fri Aug 16 10:23:55 2013 +0200
     1.3 @@ -37,12 +37,9 @@
     1.4  #include "opto/memnode.hpp"
     1.5  #include "opto/opcodes.hpp"
     1.6  
     1.7 -//=============================================================================
     1.8 -//------------------------------IFG--------------------------------------------
     1.9  PhaseIFG::PhaseIFG( Arena *arena ) : Phase(Interference_Graph), _arena(arena) {
    1.10  }
    1.11  
    1.12 -//------------------------------init-------------------------------------------
    1.13  void PhaseIFG::init( uint maxlrg ) {
    1.14    _maxlrg = maxlrg;
    1.15    _yanked = new (_arena) VectorSet(_arena);
    1.16 @@ -59,7 +56,6 @@
    1.17    }
    1.18  }
    1.19  
    1.20 -//------------------------------add--------------------------------------------
    1.21  // Add edge between vertices a & b.  These are sorted (triangular matrix),
    1.22  // then the smaller number is inserted in the larger numbered array.
    1.23  int PhaseIFG::add_edge( uint a, uint b ) {
    1.24 @@ -71,7 +67,6 @@
    1.25    return _adjs[a].insert( b );
    1.26  }
    1.27  
    1.28 -//------------------------------add_vector-------------------------------------
    1.29  // Add an edge between 'a' and everything in the vector.
    1.30  void PhaseIFG::add_vector( uint a, IndexSet *vec ) {
    1.31    // IFG is triangular, so do the inserts where 'a' < 'b'.
    1.32 @@ -86,7 +81,6 @@
    1.33    }
    1.34  }
    1.35  
    1.36 -//------------------------------test-------------------------------------------
    1.37  // Is there an edge between a and b?
    1.38  int PhaseIFG::test_edge( uint a, uint b ) const {
    1.39    // Sort a and b, so that a is larger
    1.40 @@ -95,7 +89,6 @@
    1.41    return _adjs[a].member(b);
    1.42  }
    1.43  
    1.44 -//------------------------------SquareUp---------------------------------------
    1.45  // Convert triangular matrix to square matrix
    1.46  void PhaseIFG::SquareUp() {
    1.47    assert( !_is_square, "only on triangular" );
    1.48 @@ -111,7 +104,6 @@
    1.49    _is_square = true;
    1.50  }
    1.51  
    1.52 -//------------------------------Compute_Effective_Degree-----------------------
    1.53  // Compute effective degree in bulk
    1.54  void PhaseIFG::Compute_Effective_Degree() {
    1.55    assert( _is_square, "only on square" );
    1.56 @@ -120,7 +112,6 @@
    1.57      lrgs(i).set_degree(effective_degree(i));
    1.58  }
    1.59  
    1.60 -//------------------------------test_edge_sq-----------------------------------
    1.61  int PhaseIFG::test_edge_sq( uint a, uint b ) const {
    1.62    assert( _is_square, "only on square" );
    1.63    // Swap, so that 'a' has the lesser count.  Then binary search is on
    1.64 @@ -130,7 +121,6 @@
    1.65    return _adjs[a].member(b);
    1.66  }
    1.67  
    1.68 -//------------------------------Union------------------------------------------
    1.69  // Union edges of B into A
    1.70  void PhaseIFG::Union( uint a, uint b ) {
    1.71    assert( _is_square, "only on square" );
    1.72 @@ -146,7 +136,6 @@
    1.73    }
    1.74  }
    1.75  
    1.76 -//------------------------------remove_node------------------------------------
    1.77  // Yank a Node and all connected edges from the IFG.  Return a
    1.78  // list of neighbors (edges) yanked.
    1.79  IndexSet *PhaseIFG::remove_node( uint a ) {
    1.80 @@ -165,7 +154,6 @@
    1.81    return neighbors(a);
    1.82  }
    1.83  
    1.84 -//------------------------------re_insert--------------------------------------
    1.85  // Re-insert a yanked Node.
    1.86  void PhaseIFG::re_insert( uint a ) {
    1.87    assert( _is_square, "only on square" );
    1.88 @@ -180,7 +168,6 @@
    1.89    }
    1.90  }
    1.91  
    1.92 -//------------------------------compute_degree---------------------------------
    1.93  // Compute the degree between 2 live ranges.  If both live ranges are
    1.94  // aligned-adjacent powers-of-2 then we use the MAX size.  If either is
    1.95  // mis-aligned (or for Fat-Projections, not-adjacent) then we have to
    1.96 @@ -196,7 +183,6 @@
    1.97    return tmp;
    1.98  }
    1.99  
   1.100 -//------------------------------effective_degree-------------------------------
   1.101  // Compute effective degree for this live range.  If both live ranges are
   1.102  // aligned-adjacent powers-of-2 then we use the MAX size.  If either is
   1.103  // mis-aligned (or for Fat-Projections, not-adjacent) then we have to
   1.104 @@ -221,7 +207,6 @@
   1.105  
   1.106  
   1.107  #ifndef PRODUCT
   1.108 -//------------------------------dump-------------------------------------------
   1.109  void PhaseIFG::dump() const {
   1.110    tty->print_cr("-- Interference Graph --%s--",
   1.111                  _is_square ? "square" : "triangular" );
   1.112 @@ -260,7 +245,6 @@
   1.113    tty->print("\n");
   1.114  }
   1.115  
   1.116 -//------------------------------stats------------------------------------------
   1.117  void PhaseIFG::stats() const {
   1.118    ResourceMark rm;
   1.119    int *h_cnt = NEW_RESOURCE_ARRAY(int,_maxlrg*2);
   1.120 @@ -276,7 +260,6 @@
   1.121    tty->print_cr("");
   1.122  }
   1.123  
   1.124 -//------------------------------verify-----------------------------------------
   1.125  void PhaseIFG::verify( const PhaseChaitin *pc ) const {
   1.126    // IFG is square, sorted and no need for Find
   1.127    for( uint i = 0; i < _maxlrg; i++ ) {
   1.128 @@ -298,7 +281,6 @@
   1.129  }
   1.130  #endif
   1.131  
   1.132 -//------------------------------interfere_with_live----------------------------
   1.133  // Interfere this register with everything currently live.  Use the RegMasks
   1.134  // to trim the set of possible interferences. Return a count of register-only
   1.135  // interferences as an estimate of register pressure.
   1.136 @@ -315,7 +297,6 @@
   1.137        _ifg->add_edge( r, l );
   1.138  }
   1.139  
   1.140 -//------------------------------build_ifg_virtual------------------------------
   1.141  // Actually build the interference graph.  Uses virtual registers only, no
   1.142  // physical register masks.  This allows me to be very aggressive when
   1.143  // coalescing copies.  Some of this aggressiveness will have to be undone
   1.144 @@ -325,9 +306,9 @@
   1.145  void PhaseChaitin::build_ifg_virtual( ) {
   1.146  
   1.147    // For all blocks (in any order) do...
   1.148 -  for( uint i=0; i<_cfg._num_blocks; i++ ) {
   1.149 -    Block *b = _cfg._blocks[i];
   1.150 -    IndexSet *liveout = _live->live(b);
   1.151 +  for (uint i = 0; i < _cfg.number_of_blocks(); i++) {
   1.152 +    Block* block = _cfg.get_block(i);
   1.153 +    IndexSet* liveout = _live->live(block);
   1.154  
   1.155      // The IFG is built by a single reverse pass over each basic block.
   1.156      // Starting with the known live-out set, we remove things that get
   1.157 @@ -337,8 +318,8 @@
   1.158      // The defined value interferes with everything currently live.  The
   1.159      // value is then removed from the live-ness set and it's inputs are
   1.160      // added to the live-ness set.
   1.161 -    for( uint j = b->end_idx() + 1; j > 1; j-- ) {
   1.162 -      Node *n = b->_nodes[j-1];
   1.163 +    for (uint j = block->end_idx() + 1; j > 1; j--) {
   1.164 +      Node* n = block->_nodes[j - 1];
   1.165  
   1.166        // Get value being defined
   1.167        uint r = _lrg_map.live_range_id(n);
   1.168 @@ -408,7 +389,6 @@
   1.169    } // End of forall blocks
   1.170  }
   1.171  
   1.172 -//------------------------------count_int_pressure-----------------------------
   1.173  uint PhaseChaitin::count_int_pressure( IndexSet *liveout ) {
   1.174    IndexSetIterator elements(liveout);
   1.175    uint lidx;
   1.176 @@ -424,7 +404,6 @@
   1.177    return cnt;
   1.178  }
   1.179  
   1.180 -//------------------------------count_float_pressure---------------------------
   1.181  uint PhaseChaitin::count_float_pressure( IndexSet *liveout ) {
   1.182    IndexSetIterator elements(liveout);
   1.183    uint lidx;
   1.184 @@ -438,7 +417,6 @@
   1.185    return cnt;
   1.186  }
   1.187  
   1.188 -//------------------------------lower_pressure---------------------------------
   1.189  // Adjust register pressure down by 1.  Capture last hi-to-low transition,
   1.190  static void lower_pressure( LRG *lrg, uint where, Block *b, uint *pressure, uint *hrp_index ) {
   1.191    if (lrg->mask().is_UP() && lrg->mask_size()) {
   1.192 @@ -460,40 +438,41 @@
   1.193    }
   1.194  }
   1.195  
   1.196 -//------------------------------build_ifg_physical-----------------------------
   1.197  // Build the interference graph using physical registers when available.
   1.198  // That is, if 2 live ranges are simultaneously alive but in their acceptable
   1.199  // register sets do not overlap, then they do not interfere.
   1.200  uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
   1.201    NOT_PRODUCT( Compile::TracePhase t3("buildIFG", &_t_buildIFGphysical, TimeCompiler); )
   1.202  
   1.203 -  uint spill_reg = LRG::SPILL_REG;
   1.204    uint must_spill = 0;
   1.205  
   1.206    // For all blocks (in any order) do...
   1.207 -  for( uint i = 0; i < _cfg._num_blocks; i++ ) {
   1.208 -    Block *b = _cfg._blocks[i];
   1.209 +  for (uint i = 0; i < _cfg.number_of_blocks(); i++) {
   1.210 +    Block* block = _cfg.get_block(i);
   1.211      // Clone (rather than smash in place) the liveout info, so it is alive
   1.212      // for the "collect_gc_info" phase later.
   1.213 -    IndexSet liveout(_live->live(b));
   1.214 -    uint last_inst = b->end_idx();
   1.215 +    IndexSet liveout(_live->live(block));
   1.216 +    uint last_inst = block->end_idx();
   1.217      // Compute first nonphi node index
   1.218      uint first_inst;
   1.219 -    for( first_inst = 1; first_inst < last_inst; first_inst++ )
   1.220 -      if( !b->_nodes[first_inst]->is_Phi() )
   1.221 +    for (first_inst = 1; first_inst < last_inst; first_inst++) {
   1.222 +      if (!block->_nodes[first_inst]->is_Phi()) {
   1.223          break;
   1.224 +      }
   1.225 +    }
   1.226  
   1.227      // Spills could be inserted before CreateEx node which should be
   1.228      // first instruction in block after Phis. Move CreateEx up.
   1.229 -    for( uint insidx = first_inst; insidx < last_inst; insidx++ ) {
   1.230 -      Node *ex = b->_nodes[insidx];
   1.231 -      if( ex->is_SpillCopy() ) continue;
   1.232 -      if( insidx > first_inst && ex->is_Mach() &&
   1.233 -          ex->as_Mach()->ideal_Opcode() == Op_CreateEx ) {
   1.234 +    for (uint insidx = first_inst; insidx < last_inst; insidx++) {
   1.235 +      Node *ex = block->_nodes[insidx];
   1.236 +      if (ex->is_SpillCopy()) {
   1.237 +        continue;
   1.238 +      }
   1.239 +      if (insidx > first_inst && ex->is_Mach() && ex->as_Mach()->ideal_Opcode() == Op_CreateEx) {
   1.240          // If the CreateEx isn't above all the MachSpillCopies
   1.241          // then move it to the top.
   1.242 -        b->_nodes.remove(insidx);
   1.243 -        b->_nodes.insert(first_inst, ex);
   1.244 +        block->_nodes.remove(insidx);
   1.245 +        block->_nodes.insert(first_inst, ex);
   1.246        }
   1.247        // Stop once a CreateEx or any other node is found
   1.248        break;
   1.249 @@ -503,12 +482,12 @@
   1.250      uint pressure[2], hrp_index[2];
   1.251      pressure[0] = pressure[1] = 0;
   1.252      hrp_index[0] = hrp_index[1] = last_inst+1;
   1.253 -    b->_reg_pressure = b->_freg_pressure = 0;
   1.254 +    block->_reg_pressure = block->_freg_pressure = 0;
   1.255      // Liveout things are presumed live for the whole block.  We accumulate
   1.256      // 'area' accordingly.  If they get killed in the block, we'll subtract
   1.257      // the unused part of the block from the area.
   1.258      int inst_count = last_inst - first_inst;
   1.259 -    double cost = (inst_count <= 0) ? 0.0 : b->_freq * double(inst_count);
   1.260 +    double cost = (inst_count <= 0) ? 0.0 : block->_freq * double(inst_count);
   1.261      assert(!(cost < 0.0), "negative spill cost" );
   1.262      IndexSetIterator elements(&liveout);
   1.263      uint lidx;
   1.264 @@ -519,13 +498,15 @@
   1.265        if (lrg.mask().is_UP() && lrg.mask_size()) {
   1.266          if (lrg._is_float || lrg._is_vector) {   // Count float pressure
   1.267            pressure[1] += lrg.reg_pressure();
   1.268 -          if( pressure[1] > b->_freg_pressure )
   1.269 -            b->_freg_pressure = pressure[1];
   1.270 +          if (pressure[1] > block->_freg_pressure) {
   1.271 +            block->_freg_pressure = pressure[1];
   1.272 +          }
   1.273            // Count int pressure, but do not count the SP, flags
   1.274 -        } else if( lrgs(lidx).mask().overlap(*Matcher::idealreg2regmask[Op_RegI]) ) {
   1.275 +        } else if(lrgs(lidx).mask().overlap(*Matcher::idealreg2regmask[Op_RegI])) {
   1.276            pressure[0] += lrg.reg_pressure();
   1.277 -          if( pressure[0] > b->_reg_pressure )
   1.278 -            b->_reg_pressure = pressure[0];
   1.279 +          if (pressure[0] > block->_reg_pressure) {
   1.280 +            block->_reg_pressure = pressure[0];
   1.281 +          }
   1.282          }
   1.283        }
   1.284      }
   1.285 @@ -541,8 +522,8 @@
   1.286      // value is then removed from the live-ness set and it's inputs are added
   1.287      // to the live-ness set.
   1.288      uint j;
   1.289 -    for( j = last_inst + 1; j > 1; j-- ) {
   1.290 -      Node *n = b->_nodes[j - 1];
   1.291 +    for (j = last_inst + 1; j > 1; j--) {
   1.292 +      Node* n = block->_nodes[j - 1];
   1.293  
   1.294        // Get value being defined
   1.295        uint r = _lrg_map.live_range_id(n);
   1.296 @@ -551,7 +532,7 @@
   1.297        if(r) {
   1.298          // A DEF normally costs block frequency; rematerialized values are
   1.299          // removed from the DEF sight, so LOWER costs here.
   1.300 -        lrgs(r)._cost += n->rematerialize() ? 0 : b->_freq;
   1.301 +        lrgs(r)._cost += n->rematerialize() ? 0 : block->_freq;
   1.302  
   1.303          // If it is not live, then this instruction is dead.  Probably caused
   1.304          // by spilling and rematerialization.  Who cares why, yank this baby.
   1.305 @@ -560,7 +541,7 @@
   1.306            if( !n->is_Proj() ||
   1.307                // Could also be a flags-projection of a dead ADD or such.
   1.308                (_lrg_map.live_range_id(def) && !liveout.member(_lrg_map.live_range_id(def)))) {
   1.309 -            b->_nodes.remove(j - 1);
   1.310 +            block->_nodes.remove(j - 1);
   1.311              if (lrgs(r)._def == n) {
   1.312                lrgs(r)._def = 0;
   1.313              }
   1.314 @@ -580,21 +561,21 @@
   1.315              RegMask itmp = lrgs(r).mask();
   1.316              itmp.AND(*Matcher::idealreg2regmask[Op_RegI]);
   1.317              int iregs = itmp.Size();
   1.318 -            if( pressure[0]+iregs > b->_reg_pressure )
   1.319 -              b->_reg_pressure = pressure[0]+iregs;
   1.320 -            if( pressure[0]       <= (uint)INTPRESSURE &&
   1.321 -                pressure[0]+iregs >  (uint)INTPRESSURE ) {
   1.322 -              hrp_index[0] = j-1;
   1.323 +            if (pressure[0]+iregs > block->_reg_pressure) {
   1.324 +              block->_reg_pressure = pressure[0] + iregs;
   1.325 +            }
   1.326 +            if (pressure[0] <= (uint)INTPRESSURE && pressure[0] + iregs > (uint)INTPRESSURE) {
   1.327 +              hrp_index[0] = j - 1;
   1.328              }
   1.329              // Count the float-only registers
   1.330              RegMask ftmp = lrgs(r).mask();
   1.331              ftmp.AND(*Matcher::idealreg2regmask[Op_RegD]);
   1.332              int fregs = ftmp.Size();
   1.333 -            if( pressure[1]+fregs > b->_freg_pressure )
   1.334 -              b->_freg_pressure = pressure[1]+fregs;
   1.335 -            if( pressure[1]       <= (uint)FLOATPRESSURE &&
   1.336 -                pressure[1]+fregs >  (uint)FLOATPRESSURE ) {
   1.337 -              hrp_index[1] = j-1;
   1.338 +            if (pressure[1] + fregs > block->_freg_pressure) {
   1.339 +              block->_freg_pressure = pressure[1] + fregs;
   1.340 +            }
   1.341 +            if(pressure[1] <= (uint)FLOATPRESSURE && pressure[1]+fregs > (uint)FLOATPRESSURE) {
   1.342 +              hrp_index[1] = j - 1;
   1.343              }
   1.344            }
   1.345  
   1.346 @@ -607,7 +588,7 @@
   1.347            if( n->is_SpillCopy()
   1.348                && lrgs(r).is_singledef()        // MultiDef live range can still split
   1.349                && n->outcnt() == 1              // and use must be in this block
   1.350 -              && _cfg.get_block_for_node(n->unique_out()) == b ) {
   1.351 +              && _cfg.get_block_for_node(n->unique_out()) == block) {
   1.352              // All single-use MachSpillCopy(s) that immediately precede their
   1.353              // use must color early.  If a longer live range steals their
   1.354              // color, the spill copy will split and may push another spill copy
   1.355 @@ -617,14 +598,16 @@
   1.356              //
   1.357  
   1.358              Node *single_use = n->unique_out();
   1.359 -            assert( b->find_node(single_use) >= j, "Use must be later in block");
   1.360 +            assert(block->find_node(single_use) >= j, "Use must be later in block");
   1.361              // Use can be earlier in block if it is a Phi, but then I should be a MultiDef
   1.362  
   1.363              // Find first non SpillCopy 'm' that follows the current instruction
   1.364              // (j - 1) is index for current instruction 'n'
   1.365              Node *m = n;
   1.366 -            for( uint i = j; i <= last_inst && m->is_SpillCopy(); ++i ) { m = b->_nodes[i]; }
   1.367 -            if( m == single_use ) {
   1.368 +            for (uint i = j; i <= last_inst && m->is_SpillCopy(); ++i) {
   1.369 +              m = block->_nodes[i];
   1.370 +            }
   1.371 +            if (m == single_use) {
   1.372                lrgs(r)._area = 0.0;
   1.373              }
   1.374            }
   1.375 @@ -633,7 +616,7 @@
   1.376            if( liveout.remove(r) ) {
   1.377              // Adjust register pressure.
   1.378              // Capture last hi-to-lo pressure transition
   1.379 -            lower_pressure( &lrgs(r), j-1, b, pressure, hrp_index );
   1.380 +            lower_pressure(&lrgs(r), j - 1, block, pressure, hrp_index);
   1.381              assert( pressure[0] == count_int_pressure  (&liveout), "" );
   1.382              assert( pressure[1] == count_float_pressure(&liveout), "" );
   1.383            }
   1.384 @@ -646,7 +629,7 @@
   1.385              if (liveout.remove(x)) {
   1.386                lrgs(x)._area -= cost;
   1.387                // Adjust register pressure.
   1.388 -              lower_pressure(&lrgs(x), j-1, b, pressure, hrp_index);
   1.389 +              lower_pressure(&lrgs(x), j - 1, block, pressure, hrp_index);
   1.390                assert( pressure[0] == count_int_pressure  (&liveout), "" );
   1.391                assert( pressure[1] == count_float_pressure(&liveout), "" );
   1.392              }
   1.393 @@ -718,7 +701,7 @@
   1.394  
   1.395        // Area remaining in the block
   1.396        inst_count--;
   1.397 -      cost = (inst_count <= 0) ? 0.0 : b->_freq * double(inst_count);
   1.398 +      cost = (inst_count <= 0) ? 0.0 : block->_freq * double(inst_count);
   1.399  
   1.400        // Make all inputs live
   1.401        if( !n->is_Phi() ) {      // Phi function uses come from prior block
   1.402 @@ -743,7 +726,7 @@
   1.403            if (k < debug_start) {
   1.404              // A USE costs twice block frequency (once for the Load, once
   1.405              // for a Load-delay).  Rematerialized uses only cost once.
   1.406 -            lrg._cost += (def->rematerialize() ? b->_freq : (b->_freq + b->_freq));
   1.407 +            lrg._cost += (def->rematerialize() ? block->_freq : (block->_freq + block->_freq));
   1.408            }
   1.409            // It is live now
   1.410            if (liveout.insert(x)) {
   1.411 @@ -753,12 +736,14 @@
   1.412              if (lrg.mask().is_UP() && lrg.mask_size()) {
   1.413                if (lrg._is_float || lrg._is_vector) {
   1.414                  pressure[1] += lrg.reg_pressure();
   1.415 -                if( pressure[1] > b->_freg_pressure )
   1.416 -                  b->_freg_pressure = pressure[1];
   1.417 +                if (pressure[1] > block->_freg_pressure)  {
   1.418 +                  block->_freg_pressure = pressure[1];
   1.419 +                }
   1.420                } else if( lrg.mask().overlap(*Matcher::idealreg2regmask[Op_RegI]) ) {
   1.421                  pressure[0] += lrg.reg_pressure();
   1.422 -                if( pressure[0] > b->_reg_pressure )
   1.423 -                  b->_reg_pressure = pressure[0];
   1.424 +                if (pressure[0] > block->_reg_pressure) {
   1.425 +                  block->_reg_pressure = pressure[0];
   1.426 +                }
   1.427                }
   1.428              }
   1.429              assert( pressure[0] == count_int_pressure  (&liveout), "" );
   1.430 @@ -772,44 +757,47 @@
   1.431      // If we run off the top of the block with high pressure and
   1.432      // never see a hi-to-low pressure transition, just record that
   1.433      // the whole block is high pressure.
   1.434 -    if( pressure[0] > (uint)INTPRESSURE   ) {
   1.435 +    if (pressure[0] > (uint)INTPRESSURE) {
   1.436        hrp_index[0] = 0;
   1.437 -      if( pressure[0] > b->_reg_pressure )
   1.438 -        b->_reg_pressure = pressure[0];
   1.439 +      if (pressure[0] > block->_reg_pressure) {
   1.440 +        block->_reg_pressure = pressure[0];
   1.441 +      }
   1.442      }
   1.443 -    if( pressure[1] > (uint)FLOATPRESSURE ) {
   1.444 +    if (pressure[1] > (uint)FLOATPRESSURE) {
   1.445        hrp_index[1] = 0;
   1.446 -      if( pressure[1] > b->_freg_pressure )
   1.447 -        b->_freg_pressure = pressure[1];
   1.448 +      if (pressure[1] > block->_freg_pressure) {
   1.449 +        block->_freg_pressure = pressure[1];
   1.450 +      }
   1.451      }
   1.452  
   1.453      // Compute high pressure indice; avoid landing in the middle of projnodes
   1.454      j = hrp_index[0];
   1.455 -    if( j < b->_nodes.size() && j < b->end_idx()+1 ) {
   1.456 -      Node *cur = b->_nodes[j];
   1.457 -      while( cur->is_Proj() || (cur->is_MachNullCheck()) || cur->is_Catch() ) {
   1.458 +    if (j < block->_nodes.size() && j < block->end_idx() + 1) {
   1.459 +      Node* cur = block->_nodes[j];
   1.460 +      while (cur->is_Proj() || (cur->is_MachNullCheck()) || cur->is_Catch()) {
   1.461          j--;
   1.462 -        cur = b->_nodes[j];
   1.463 +        cur = block->_nodes[j];
   1.464        }
   1.465      }
   1.466 -    b->_ihrp_index = j;
   1.467 +    block->_ihrp_index = j;
   1.468      j = hrp_index[1];
   1.469 -    if( j < b->_nodes.size() && j < b->end_idx()+1 ) {
   1.470 -      Node *cur = b->_nodes[j];
   1.471 -      while( cur->is_Proj() || (cur->is_MachNullCheck()) || cur->is_Catch() ) {
   1.472 +    if (j < block->_nodes.size() && j < block->end_idx() + 1) {
   1.473 +      Node* cur = block->_nodes[j];
   1.474 +      while (cur->is_Proj() || (cur->is_MachNullCheck()) || cur->is_Catch()) {
   1.475          j--;
   1.476 -        cur = b->_nodes[j];
   1.477 +        cur = block->_nodes[j];
   1.478        }
   1.479      }
   1.480 -    b->_fhrp_index = j;
   1.481 +    block->_fhrp_index = j;
   1.482  
   1.483  #ifndef PRODUCT
   1.484      // Gather Register Pressure Statistics
   1.485      if( PrintOptoStatistics ) {
   1.486 -      if( b->_reg_pressure > (uint)INTPRESSURE || b->_freg_pressure > (uint)FLOATPRESSURE )
   1.487 +      if (block->_reg_pressure > (uint)INTPRESSURE || block->_freg_pressure > (uint)FLOATPRESSURE) {
   1.488          _high_pressure++;
   1.489 -      else
   1.490 +      } else {
   1.491          _low_pressure++;
   1.492 +      }
   1.493      }
   1.494  #endif
   1.495    } // End of for all blocks

mercurial