src/share/vm/opto/chaitin.cpp

changeset 5635
650868c062a9
parent 5543
4b2838704fd5
child 5722
8c83625e3a53
     1.1 --- a/src/share/vm/opto/chaitin.cpp	Mon Aug 26 16:12:20 2013 +0200
     1.2 +++ b/src/share/vm/opto/chaitin.cpp	Mon Aug 26 12:50:23 2013 +0200
     1.3 @@ -301,7 +301,7 @@
     1.4        // Copy kill projections after the cloned node
     1.5        Node* kills = proj->clone();
     1.6        kills->set_req(0, copy);
     1.7 -      b->_nodes.insert(idx++, kills);
     1.8 +      b->insert_node(kills, idx++);
     1.9        _cfg.map_node_to_block(kills, b);
    1.10        new_lrg(kills, max_lrg_id++);
    1.11      }
    1.12 @@ -682,11 +682,11 @@
    1.13    uint lr_counter = 1;
    1.14    for( uint i = 0; i < _cfg.number_of_blocks(); i++ ) {
    1.15      Block* block = _cfg.get_block(i);
    1.16 -    uint cnt = block->_nodes.size();
    1.17 +    uint cnt = block->number_of_nodes();
    1.18  
    1.19      // Handle all the normal Nodes in the block
    1.20      for( uint j = 0; j < cnt; j++ ) {
    1.21 -      Node *n = block->_nodes[j];
    1.22 +      Node *n = block->get_node(j);
    1.23        // Pre-color to the zero live range, or pick virtual register
    1.24        const RegMask &rm = n->out_RegMask();
    1.25        _lrg_map.map(n->_idx, rm.is_NotEmpty() ? lr_counter++ : 0);
    1.26 @@ -710,8 +710,8 @@
    1.27      Block* block = _cfg.get_block(i);
    1.28  
    1.29      // For all instructions
    1.30 -    for (uint j = 1; j < block->_nodes.size(); j++) {
    1.31 -      Node* n = block->_nodes[j];
    1.32 +    for (uint j = 1; j < block->number_of_nodes(); j++) {
    1.33 +      Node* n = block->get_node(j);
    1.34        uint input_edge_start =1; // Skip control most nodes
    1.35        if (n->is_Mach()) {
    1.36          input_edge_start = n->as_Mach()->oper_input_base();
    1.37 @@ -1604,7 +1604,7 @@
    1.38      // For all instructions in block
    1.39      uint last_inst = block->end_idx();
    1.40      for (uint j = 1; j <= last_inst; j++) {
    1.41 -      Node* n = block->_nodes[j];
    1.42 +      Node* n = block->get_node(j);
    1.43  
    1.44        // Dead instruction???
    1.45        assert( n->outcnt() != 0 ||// Nothing dead after post alloc
    1.46 @@ -1641,7 +1641,7 @@
    1.47              assert( cisc->oper_input_base() == 2, "Only adding one edge");
    1.48              cisc->ins_req(1,src);         // Requires a memory edge
    1.49            }
    1.50 -          block->_nodes.map(j,cisc);          // Insert into basic block
    1.51 +          block->map_node(cisc, j);          // Insert into basic block
    1.52            n->subsume_by(cisc, C); // Correct graph
    1.53            //
    1.54            ++_used_cisc_instructions;
    1.55 @@ -1698,7 +1698,7 @@
    1.56        // (where top() node is placed).
    1.57        base->init_req(0, _cfg.get_root_node());
    1.58        Block *startb = _cfg.get_block_for_node(C->top());
    1.59 -      startb->_nodes.insert(startb->find_node(C->top()), base );
    1.60 +      startb->insert_node(base, startb->find_node(C->top()));
    1.61        _cfg.map_node_to_block(base, startb);
    1.62        assert(_lrg_map.live_range_id(base) == 0, "should not have LRG yet");
    1.63      }
    1.64 @@ -1743,9 +1743,9 @@
    1.65    // Search the current block for an existing base-Phi
    1.66    Block *b = _cfg.get_block_for_node(derived);
    1.67    for( i = 1; i <= b->end_idx(); i++ ) {// Search for matching Phi
    1.68 -    Node *phi = b->_nodes[i];
    1.69 +    Node *phi = b->get_node(i);
    1.70      if( !phi->is_Phi() ) {      // Found end of Phis with no match?
    1.71 -      b->_nodes.insert( i, base ); // Must insert created Phi here as base
    1.72 +      b->insert_node(base,  i); // Must insert created Phi here as base
    1.73        _cfg.map_node_to_block(base, b);
    1.74        new_lrg(base,maxlrg++);
    1.75        break;
    1.76 @@ -1786,7 +1786,7 @@
    1.77      IndexSet liveout(_live->live(block));
    1.78  
    1.79      for (uint j = block->end_idx() + 1; j > 1; j--) {
    1.80 -      Node* n = block->_nodes[j - 1];
    1.81 +      Node* n = block->get_node(j - 1);
    1.82  
    1.83        // Pre-split compares of loop-phis.  Loop-phis form a cycle we would
    1.84        // like to see in the same register.  Compare uses the loop-phi and so
    1.85 @@ -1979,8 +1979,8 @@
    1.86    b->dump_head(&_cfg);
    1.87  
    1.88    // For all instructions
    1.89 -  for( uint j = 0; j < b->_nodes.size(); j++ )
    1.90 -    dump(b->_nodes[j]);
    1.91 +  for( uint j = 0; j < b->number_of_nodes(); j++ )
    1.92 +    dump(b->get_node(j));
    1.93    // Print live-out info at end of block
    1.94    if( _live ) {
    1.95      tty->print("Liveout: ");
    1.96 @@ -2271,8 +2271,8 @@
    1.97      int dump_once = 0;
    1.98  
    1.99      // For all instructions
   1.100 -    for( uint j = 0; j < block->_nodes.size(); j++ ) {
   1.101 -      Node *n = block->_nodes[j];
   1.102 +    for( uint j = 0; j < block->number_of_nodes(); j++ ) {
   1.103 +      Node *n = block->get_node(j);
   1.104        if (_lrg_map.find_const(n) == lidx) {
   1.105          if (!dump_once++) {
   1.106            tty->cr();

mercurial