comparison src/share/vm/opto/lcm.cpp @ 356:1ee8caae33af

Merge
author tonyp
date Thu, 21 Aug 2008 23:36:31 -0400
parents 6aae2f9d0294 b0fe4deeb9fb
children 5f44674206d3
comparison
equal deleted inserted replaced
355:0edda524b58c 356:1ee8caae33af
1 /* 1 /*
2 * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
320 } 320 }
321 321
322 uint choice = 0; // Bigger is most important 322 uint choice = 0; // Bigger is most important
323 uint latency = 0; // Bigger is scheduled first 323 uint latency = 0; // Bigger is scheduled first
324 uint score = 0; // Bigger is better 324 uint score = 0; // Bigger is better
325 uint idx; // Index in worklist 325 int idx = -1; // Index in worklist
326 326
327 for( uint i=0; i<cnt; i++ ) { // Inspect entire worklist 327 for( uint i=0; i<cnt; i++ ) { // Inspect entire worklist
328 // Order in worklist is used to break ties. 328 // Order in worklist is used to break ties.
329 // See caller for how this is used to delay scheduling 329 // See caller for how this is used to delay scheduling
330 // of induction variable increments to after the other 330 // of induction variable increments to after the other
410 score = n_score; 410 score = n_score;
411 idx = i; // Also keep index in worklist 411 idx = i; // Also keep index in worklist
412 } 412 }
413 } // End of for all ready nodes in worklist 413 } // End of for all ready nodes in worklist
414 414
415 Node *n = worklist[idx]; // Get the winner 415 assert(idx >= 0, "index should be set");
416 416 Node *n = worklist[(uint)idx]; // Get the winner
417 worklist.map(idx,worklist.pop()); // Compress worklist 417
418 worklist.map((uint)idx, worklist.pop()); // Compress worklist
418 return n; 419 return n;
419 } 420 }
420 421
421 422
422 //------------------------------set_next_call---------------------------------- 423 //------------------------------set_next_call----------------------------------
597 n->del_req(n->req() - 1); 598 n->del_req(n->req() - 1);
598 n->add_prec(oop_store); 599 n->add_prec(oop_store);
599 assert(cfg->_bbs[oop_store->_idx]->_dom_depth <= this->_dom_depth, "oop_store must dominate card-mark"); 600 assert(cfg->_bbs[oop_store->_idx]->_dom_depth <= this->_dom_depth, "oop_store must dominate card-mark");
600 } 601 }
601 } 602 }
602 if( n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_MemBarAcquire ) { 603 if( n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_MemBarAcquire &&
604 n->req() > TypeFunc::Parms ) {
605 // MemBarAcquire could be created without Precedent edge.
606 // del_req() replaces the specified edge with the last input edge
607 // and then removes the last edge. If the specified edge > number of
608 // edges the last edge will be moved outside of the input edges array
609 // and the edge will be lost. This is why this code should be
610 // executed only when Precedent (== TypeFunc::Parms) edge is present.
603 Node *x = n->in(TypeFunc::Parms); 611 Node *x = n->in(TypeFunc::Parms);
604 n->del_req(TypeFunc::Parms); 612 n->del_req(TypeFunc::Parms);
605 n->add_prec(x); 613 n->add_prec(x);
606 } 614 }
607 } 615 }