src/share/vm/opto/gcm.cpp

changeset 6472
2b8e28fdf503
parent 6462
e2722a66aba7
parent 5639
4b078f877b56
child 6490
41b780b43b74
     1.1 --- a/src/share/vm/opto/gcm.cpp	Wed Oct 16 10:52:41 2013 +0200
     1.2 +++ b/src/share/vm/opto/gcm.cpp	Tue Nov 05 17:38:04 2013 -0800
     1.3 @@ -106,12 +106,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 @@ -1031,8 +1031,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 @@ -1053,9 +1053,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 @@ -1078,14 +1078,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 @@ -1346,7 +1346,7 @@
    1.60        Node* proj = _matcher._null_check_tests[i];
    1.61        Node* val  = _matcher._null_check_tests[i + 1];
    1.62        Block* block = get_block_for_node(proj);
    1.63 -      block->implicit_null_check(this, proj, val, allowed_reasons);
    1.64 +      implicit_null_check(block, proj, val, allowed_reasons);
    1.65        // The implicit_null_check will only perform the transformation
    1.66        // if the null branch is truly uncommon, *and* it leads to an
    1.67        // uncommon trap.  Combined with the too_many_traps guards
    1.68 @@ -1367,7 +1367,7 @@
    1.69    visited.Clear();
    1.70    for (uint i = 0; i < number_of_blocks(); i++) {
    1.71      Block* block = get_block(i);
    1.72 -    if (!block->schedule_local(this, _matcher, ready_cnt, visited)) {
    1.73 +    if (!schedule_local(block, ready_cnt, visited)) {
    1.74        if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) {
    1.75          C->record_method_not_compilable("local schedule failed");
    1.76        }
    1.77 @@ -1379,7 +1379,7 @@
    1.78    // clone the instructions on all paths below the Catch.
    1.79    for (uint i = 0; i < number_of_blocks(); i++) {
    1.80      Block* block = get_block(i);
    1.81 -    block->call_catch_cleanup(this, C);
    1.82 +    call_catch_cleanup(block);
    1.83    }
    1.84  
    1.85  #ifndef PRODUCT
    1.86 @@ -1730,7 +1730,7 @@
    1.87  // Determine the probability of reaching successor 'i' from the receiver block.
    1.88  float Block::succ_prob(uint i) {
    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 @@ -1765,7 +1765,7 @@
    1.96      float prob  = n->as_MachIf()->_prob;
    1.97      assert(prob >= 0.0 && prob <= 1.0, "out of range probability");
    1.98      // If succ[i] is the FALSE branch, invert path info
    1.99 -    if( _nodes[i + eidx + 1]->Opcode() == Op_IfFalse ) {
   1.100 +    if( get_node(i + eidx + 1)->Opcode() == Op_IfFalse ) {
   1.101        return 1.0f - prob; // not taken
   1.102      } else {
   1.103        return prob; // taken
   1.104 @@ -1777,7 +1777,7 @@
   1.105      return 1.0f/_num_succs;
   1.106  
   1.107    case Op_Catch: {
   1.108 -    const CatchProjNode *ci = _nodes[i + eidx + 1]->as_CatchProj();
   1.109 +    const CatchProjNode *ci = get_node(i + eidx + 1)->as_CatchProj();
   1.110      if (ci->_con == CatchProjNode::fall_through_index) {
   1.111        // Fall-thru path gets the lion's share.
   1.112        return 1.0f - PROB_UNLIKELY_MAG(5)*_num_succs;
   1.113 @@ -1814,7 +1814,7 @@
   1.114  // Return the number of fall-through candidates for a block
   1.115  int Block::num_fall_throughs() {
   1.116    int eidx = end_idx();
   1.117 -  Node *n = _nodes[eidx];  // Get ending Node
   1.118 +  Node *n = get_node(eidx);  // Get ending Node
   1.119  
   1.120    int op = n->Opcode();
   1.121    if (n->is_Mach()) {
   1.122 @@ -1838,7 +1838,7 @@
   1.123  
   1.124    case Op_Catch: {
   1.125      for (uint i = 0; i < _num_succs; i++) {
   1.126 -      const CatchProjNode *ci = _nodes[i + eidx + 1]->as_CatchProj();
   1.127 +      const CatchProjNode *ci = get_node(i + eidx + 1)->as_CatchProj();
   1.128        if (ci->_con == CatchProjNode::fall_through_index) {
   1.129          return 1;
   1.130        }
   1.131 @@ -1866,14 +1866,14 @@
   1.132  // Return true if a specific successor could be fall-through target.
   1.133  bool Block::succ_fall_through(uint i) {
   1.134    int eidx = end_idx();
   1.135 -  Node *n = _nodes[eidx];  // Get ending Node
   1.136 +  Node *n = get_node(eidx);  // Get ending Node
   1.137  
   1.138    int op = n->Opcode();
   1.139    if (n->is_Mach()) {
   1.140      if (n->is_MachNullCheck()) {
   1.141        // In theory, either side can fall-thru, for simplicity sake,
   1.142        // let's say only the false branch can now.
   1.143 -      return _nodes[i + eidx + 1]->Opcode() == Op_IfFalse;
   1.144 +      return get_node(i + eidx + 1)->Opcode() == Op_IfFalse;
   1.145      }
   1.146      op = n->as_Mach()->ideal_Opcode();
   1.147    }
   1.148 @@ -1887,7 +1887,7 @@
   1.149      return true;
   1.150  
   1.151    case Op_Catch: {
   1.152 -    const CatchProjNode *ci = _nodes[i + eidx + 1]->as_CatchProj();
   1.153 +    const CatchProjNode *ci = get_node(i + eidx + 1)->as_CatchProj();
   1.154      return ci->_con == CatchProjNode::fall_through_index;
   1.155    }
   1.156  
   1.157 @@ -1911,7 +1911,7 @@
   1.158  // Update the probability of a two-branch to be uncommon
   1.159  void Block::update_uncommon_branch(Block* ub) {
   1.160    int eidx = end_idx();
   1.161 -  Node *n = _nodes[eidx];  // Get ending Node
   1.162 +  Node *n = get_node(eidx);  // Get ending Node
   1.163  
   1.164    int op = n->as_Mach()->ideal_Opcode();
   1.165  
   1.166 @@ -1927,7 +1927,7 @@
   1.167  
   1.168    // If ub is the true path, make the proability small, else
   1.169    // ub is the false path, and make the probability large
   1.170 -  bool invert = (_nodes[s + eidx + 1]->Opcode() == Op_IfFalse);
   1.171 +  bool invert = (get_node(s + eidx + 1)->Opcode() == Op_IfFalse);
   1.172  
   1.173    // Get existing probability
   1.174    float p = n->as_MachIf()->_prob;

mercurial