src/share/vm/opto/gcm.cpp

changeset 5635
650868c062a9
parent 5539
adb9a7d94cb5
child 5639
4b078f877b56
     1.1 --- a/src/share/vm/opto/gcm.cpp	Mon Aug 26 16:12:20 2013 +0200
     1.2 +++ b/src/share/vm/opto/gcm.cpp	Mon Aug 26 12:50:23 2013 +0200
     1.3 @@ -102,12 +102,12 @@
     1.4      uint j = 0;
     1.5      if (pb->_num_succs != 1) {  // More then 1 successor?
     1.6        // Search for successor
     1.7 -      uint max = pb->_nodes.size();
     1.8 +      uint max = pb->number_of_nodes();
     1.9        assert( max > 1, "" );
    1.10        uint start = max - pb->_num_succs;
    1.11        // Find which output path belongs to projection
    1.12        for (j = start; j < max; j++) {
    1.13 -        if( pb->_nodes[j] == in0 )
    1.14 +        if( pb->get_node(j) == in0 )
    1.15            break;
    1.16        }
    1.17        assert( j < max, "must find" );
    1.18 @@ -1027,8 +1027,8 @@
    1.19    Block* least       = LCA;
    1.20    double least_freq  = least->_freq;
    1.21    uint target        = get_latency_for_node(self);
    1.22 -  uint start_latency = get_latency_for_node(LCA->_nodes[0]);
    1.23 -  uint end_latency   = get_latency_for_node(LCA->_nodes[LCA->end_idx()]);
    1.24 +  uint start_latency = get_latency_for_node(LCA->head());
    1.25 +  uint end_latency   = get_latency_for_node(LCA->get_node(LCA->end_idx()));
    1.26    bool in_latency    = (target <= start_latency);
    1.27    const Block* root_block = get_block_for_node(_root);
    1.28  
    1.29 @@ -1049,9 +1049,9 @@
    1.30      self->dump();
    1.31      tty->print_cr("#   B%d: start latency for [%4d]=%d, end latency for [%4d]=%d, freq=%g",
    1.32        LCA->_pre_order,
    1.33 -      LCA->_nodes[0]->_idx,
    1.34 +      LCA->head()->_idx,
    1.35        start_latency,
    1.36 -      LCA->_nodes[LCA->end_idx()]->_idx,
    1.37 +      LCA->get_node(LCA->end_idx())->_idx,
    1.38        end_latency,
    1.39        least_freq);
    1.40    }
    1.41 @@ -1074,14 +1074,14 @@
    1.42      if (mach && LCA == root_block)
    1.43        break;
    1.44  
    1.45 -    uint start_lat = get_latency_for_node(LCA->_nodes[0]);
    1.46 +    uint start_lat = get_latency_for_node(LCA->head());
    1.47      uint end_idx   = LCA->end_idx();
    1.48 -    uint end_lat   = get_latency_for_node(LCA->_nodes[end_idx]);
    1.49 +    uint end_lat   = get_latency_for_node(LCA->get_node(end_idx));
    1.50      double LCA_freq = LCA->_freq;
    1.51  #ifndef PRODUCT
    1.52      if (trace_opto_pipelining()) {
    1.53        tty->print_cr("#   B%d: start latency for [%4d]=%d, end latency for [%4d]=%d, freq=%g",
    1.54 -        LCA->_pre_order, LCA->_nodes[0]->_idx, start_lat, end_idx, end_lat, LCA_freq);
    1.55 +        LCA->_pre_order, LCA->head()->_idx, start_lat, end_idx, end_lat, LCA_freq);
    1.56      }
    1.57  #endif
    1.58      cand_cnt++;
    1.59 @@ -1726,7 +1726,7 @@
    1.60  // Determine the probability of reaching successor 'i' from the receiver block.
    1.61  float Block::succ_prob(uint i) {
    1.62    int eidx = end_idx();
    1.63 -  Node *n = _nodes[eidx];  // Get ending Node
    1.64 +  Node *n = get_node(eidx);  // Get ending Node
    1.65  
    1.66    int op = n->Opcode();
    1.67    if (n->is_Mach()) {
    1.68 @@ -1761,7 +1761,7 @@
    1.69      float prob  = n->as_MachIf()->_prob;
    1.70      assert(prob >= 0.0 && prob <= 1.0, "out of range probability");
    1.71      // If succ[i] is the FALSE branch, invert path info
    1.72 -    if( _nodes[i + eidx + 1]->Opcode() == Op_IfFalse ) {
    1.73 +    if( get_node(i + eidx + 1)->Opcode() == Op_IfFalse ) {
    1.74        return 1.0f - prob; // not taken
    1.75      } else {
    1.76        return prob; // taken
    1.77 @@ -1773,7 +1773,7 @@
    1.78      return 1.0f/_num_succs;
    1.79  
    1.80    case Op_Catch: {
    1.81 -    const CatchProjNode *ci = _nodes[i + eidx + 1]->as_CatchProj();
    1.82 +    const CatchProjNode *ci = get_node(i + eidx + 1)->as_CatchProj();
    1.83      if (ci->_con == CatchProjNode::fall_through_index) {
    1.84        // Fall-thru path gets the lion's share.
    1.85        return 1.0f - PROB_UNLIKELY_MAG(5)*_num_succs;
    1.86 @@ -1810,7 +1810,7 @@
    1.87  // Return the number of fall-through candidates for a block
    1.88  int Block::num_fall_throughs() {
    1.89    int eidx = end_idx();
    1.90 -  Node *n = _nodes[eidx];  // Get ending Node
    1.91 +  Node *n = get_node(eidx);  // Get ending Node
    1.92  
    1.93    int op = n->Opcode();
    1.94    if (n->is_Mach()) {
    1.95 @@ -1834,7 +1834,7 @@
    1.96  
    1.97    case Op_Catch: {
    1.98      for (uint i = 0; i < _num_succs; i++) {
    1.99 -      const CatchProjNode *ci = _nodes[i + eidx + 1]->as_CatchProj();
   1.100 +      const CatchProjNode *ci = get_node(i + eidx + 1)->as_CatchProj();
   1.101        if (ci->_con == CatchProjNode::fall_through_index) {
   1.102          return 1;
   1.103        }
   1.104 @@ -1862,14 +1862,14 @@
   1.105  // Return true if a specific successor could be fall-through target.
   1.106  bool Block::succ_fall_through(uint i) {
   1.107    int eidx = end_idx();
   1.108 -  Node *n = _nodes[eidx];  // Get ending Node
   1.109 +  Node *n = get_node(eidx);  // Get ending Node
   1.110  
   1.111    int op = n->Opcode();
   1.112    if (n->is_Mach()) {
   1.113      if (n->is_MachNullCheck()) {
   1.114        // In theory, either side can fall-thru, for simplicity sake,
   1.115        // let's say only the false branch can now.
   1.116 -      return _nodes[i + eidx + 1]->Opcode() == Op_IfFalse;
   1.117 +      return get_node(i + eidx + 1)->Opcode() == Op_IfFalse;
   1.118      }
   1.119      op = n->as_Mach()->ideal_Opcode();
   1.120    }
   1.121 @@ -1883,7 +1883,7 @@
   1.122      return true;
   1.123  
   1.124    case Op_Catch: {
   1.125 -    const CatchProjNode *ci = _nodes[i + eidx + 1]->as_CatchProj();
   1.126 +    const CatchProjNode *ci = get_node(i + eidx + 1)->as_CatchProj();
   1.127      return ci->_con == CatchProjNode::fall_through_index;
   1.128    }
   1.129  
   1.130 @@ -1907,7 +1907,7 @@
   1.131  // Update the probability of a two-branch to be uncommon
   1.132  void Block::update_uncommon_branch(Block* ub) {
   1.133    int eidx = end_idx();
   1.134 -  Node *n = _nodes[eidx];  // Get ending Node
   1.135 +  Node *n = get_node(eidx);  // Get ending Node
   1.136  
   1.137    int op = n->as_Mach()->ideal_Opcode();
   1.138  
   1.139 @@ -1923,7 +1923,7 @@
   1.140  
   1.141    // If ub is the true path, make the proability small, else
   1.142    // ub is the false path, and make the probability large
   1.143 -  bool invert = (_nodes[s + eidx + 1]->Opcode() == Op_IfFalse);
   1.144 +  bool invert = (get_node(s + eidx + 1)->Opcode() == Op_IfFalse);
   1.145  
   1.146    // Get existing probability
   1.147    float p = n->as_MachIf()->_prob;

mercurial