src/share/vm/opto/lcm.cpp

changeset 688
b0fe4deeb9fb
parent 631
d1605aabd0a1
child 767
c792b641b8bd
child 791
1ee8caae33af
     1.1 --- a/src/share/vm/opto/lcm.cpp	Fri Jul 25 16:03:40 2008 -0700
     1.2 +++ b/src/share/vm/opto/lcm.cpp	Mon Jul 28 17:12:52 2008 -0700
     1.3 @@ -322,7 +322,7 @@
     1.4    uint choice  = 0; // Bigger is most important
     1.5    uint latency = 0; // Bigger is scheduled first
     1.6    uint score   = 0; // Bigger is better
     1.7 -  uint idx;         // Index in worklist
     1.8 +  int idx = -1;     // Index in worklist
     1.9  
    1.10    for( uint i=0; i<cnt; i++ ) { // Inspect entire worklist
    1.11      // Order in worklist is used to break ties.
    1.12 @@ -412,9 +412,10 @@
    1.13      }
    1.14    } // End of for all ready nodes in worklist
    1.15  
    1.16 -  Node *n = worklist[idx];      // Get the winner
    1.17 +  assert(idx >= 0, "index should be set");
    1.18 +  Node *n = worklist[(uint)idx];      // Get the winner
    1.19  
    1.20 -  worklist.map(idx,worklist.pop());     // Compress worklist
    1.21 +  worklist.map((uint)idx, worklist.pop());     // Compress worklist
    1.22    return n;
    1.23  }
    1.24  
    1.25 @@ -599,7 +600,14 @@
    1.26            assert(cfg->_bbs[oop_store->_idx]->_dom_depth <= this->_dom_depth, "oop_store must dominate card-mark");
    1.27          }
    1.28        }
    1.29 -      if( n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_MemBarAcquire ) {
    1.30 +      if( n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_MemBarAcquire &&
    1.31 +          n->req() > TypeFunc::Parms ) {
    1.32 +        // MemBarAcquire could be created without Precedent edge.
    1.33 +        // del_req() replaces the specified edge with the last input edge
    1.34 +        // and then removes the last edge. If the specified edge > number of
    1.35 +        // edges the last edge will be moved outside of the input edges array
    1.36 +        // and the edge will be lost. This is why this code should be
    1.37 +        // executed only when Precedent (== TypeFunc::Parms) edge is present.
    1.38          Node *x = n->in(TypeFunc::Parms);
    1.39          n->del_req(TypeFunc::Parms);
    1.40          n->add_prec(x);

mercurial