< prev index next >

src/share/vm/opto/lcm.cpp

Print this page
rev 9428 : 8143307: Crash in C2 local code motion


 482     if( n->is_Proj() ||         // Projections always win
 483         n->Opcode()== Op_Con || // So does constant 'Top'
 484         iop == Op_CreateEx ||   // Create-exception must start block
 485         iop == Op_CheckCastPP
 486         ) {
 487       worklist.map(i,worklist.pop());
 488       return n;
 489     }
 490 
 491     // Final call in a block must be adjacent to 'catch'
 492     Node *e = block->end();
 493     if( e->is_Catch() && e->in(0)->in(0) == n )
 494       continue;
 495 
 496     // Memory op for an implicit null check has to be at the end of the block
 497     if( e->is_MachNullCheck() && e->in(1) == n )
 498       continue;
 499 
 500     // Schedule IV increment last.
 501     if (e->is_Mach() && e->as_Mach()->ideal_Opcode() == Op_CountedLoopEnd &&
 502         e->in(1)->in(1) == n && n->is_iteratively_computed())

 503       continue;

 504 
 505     uint n_choice  = 2;
 506 
 507     // See if this instruction is consumed by a branch. If so, then (as the
 508     // branch is the last instruction in the basic block) force it to the
 509     // end of the basic block
 510     if ( must_clone[iop] ) {
 511       // See if any use is a branch
 512       bool found_machif = false;
 513 
 514       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 515         Node* use = n->fast_out(j);
 516 
 517         // The use is a conditional branch, make them adjacent
 518         if (use->is_MachIf() && get_block_for_node(use) == block) {
 519           found_machif = true;
 520           break;
 521         }
 522 
 523         // More than this instruction pending for successor to be ready,




 482     if( n->is_Proj() ||         // Projections always win
 483         n->Opcode()== Op_Con || // So does constant 'Top'
 484         iop == Op_CreateEx ||   // Create-exception must start block
 485         iop == Op_CheckCastPP
 486         ) {
 487       worklist.map(i,worklist.pop());
 488       return n;
 489     }
 490 
 491     // Final call in a block must be adjacent to 'catch'
 492     Node *e = block->end();
 493     if( e->is_Catch() && e->in(0)->in(0) == n )
 494       continue;
 495 
 496     // Memory op for an implicit null check has to be at the end of the block
 497     if( e->is_MachNullCheck() && e->in(1) == n )
 498       continue;
 499 
 500     // Schedule IV increment last.
 501     if (e->is_Mach() && e->as_Mach()->ideal_Opcode() == Op_CountedLoopEnd &&
 502         e->in(1)->req() > 1 && e->in(1)->in(1) == n &&
 503         n->is_iteratively_computed()) {
 504       continue;
 505     }
 506 
 507     uint n_choice  = 2;
 508 
 509     // See if this instruction is consumed by a branch. If so, then (as the
 510     // branch is the last instruction in the basic block) force it to the
 511     // end of the basic block
 512     if ( must_clone[iop] ) {
 513       // See if any use is a branch
 514       bool found_machif = false;
 515 
 516       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 517         Node* use = n->fast_out(j);
 518 
 519         // The use is a conditional branch, make them adjacent
 520         if (use->is_MachIf() && get_block_for_node(use) == block) {
 521           found_machif = true;
 522           break;
 523         }
 524 
 525         // More than this instruction pending for successor to be ready,


< prev index next >