src/share/vm/opto/block.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6851386 Sdiff src/share/vm/opto

src/share/vm/opto/block.cpp

Print this page




 893       Node *n = b->_nodes[j];
 894       assert( _bbs[n->_idx] == b, "" );
 895       if( j >= 1 && n->is_Mach() &&
 896           n->as_Mach()->ideal_Opcode() == Op_CreateEx ) {
 897         assert( j == 1 || b->_nodes[j-1]->is_Phi(),
 898                 "CreateEx must be first instruction in block" );
 899       }
 900       for( uint k = 0; k < n->req(); k++ ) {
 901         Node *def = n->in(k);
 902         if( def && def != n ) {
 903           assert( _bbs[def->_idx] || def->is_Con(),
 904                   "must have block; constants for debug info ok" );
 905           // Verify that instructions in the block is in correct order.
 906           // Uses must follow their definition if they are at the same block.
 907           // Mostly done to check that MachSpillCopy nodes are placed correctly
 908           // when CreateEx node is moved in build_ifg_physical().
 909           if( _bbs[def->_idx] == b &&
 910               !(b->head()->is_Loop() && n->is_Phi()) &&
 911               // See (+++) comment in reg_split.cpp
 912               !(n->jvms() != NULL && n->jvms()->is_monitor_use(k)) ) {
 913             assert( b->find_node(def) < j, "uses must follow definitions" );





 914           }




 915           if( def->is_SafePointScalarObject() ) {
 916             assert(_bbs[def->_idx] == b, "SafePointScalarObject Node should be at the same block as its SafePoint node");
 917             assert(_bbs[def->_idx] == _bbs[def->in(0)->_idx], "SafePointScalarObject Node should be at the same block as its control edge");
 918           }
 919         }
 920       }
 921     }
 922 
 923     j = b->end_idx();
 924     Node *bp = (Node*)b->_nodes[b->_nodes.size()-1]->is_block_proj();
 925     assert( bp, "last instruction must be a block proj" );
 926     assert( bp == b->_nodes[j], "wrong number of successors for this block" );
 927     if( bp->is_Catch() ) {
 928       while( b->_nodes[--j]->Opcode() == Op_MachProj ) ;
 929       assert( b->_nodes[j]->is_Call(), "CatchProj must follow call" );
 930     }
 931     else if( bp->is_Mach() && bp->as_Mach()->ideal_Opcode() == Op_If ) {
 932       assert( b->_num_succs == 2, "Conditional branch must have two targets");
 933     }
 934   }




 893       Node *n = b->_nodes[j];
 894       assert( _bbs[n->_idx] == b, "" );
 895       if( j >= 1 && n->is_Mach() &&
 896           n->as_Mach()->ideal_Opcode() == Op_CreateEx ) {
 897         assert( j == 1 || b->_nodes[j-1]->is_Phi(),
 898                 "CreateEx must be first instruction in block" );
 899       }
 900       for( uint k = 0; k < n->req(); k++ ) {
 901         Node *def = n->in(k);
 902         if( def && def != n ) {
 903           assert( _bbs[def->_idx] || def->is_Con(),
 904                   "must have block; constants for debug info ok" );
 905           // Verify that instructions in the block is in correct order.
 906           // Uses must follow their definition if they are at the same block.
 907           // Mostly done to check that MachSpillCopy nodes are placed correctly
 908           // when CreateEx node is moved in build_ifg_physical().
 909           if( _bbs[def->_idx] == b &&
 910               !(b->head()->is_Loop() && n->is_Phi()) &&
 911               // See (+++) comment in reg_split.cpp
 912               !(n->jvms() != NULL && n->jvms()->is_monitor_use(k)) ) {
 913             bool is_loop = false;
 914             if (n->is_Phi()) {
 915               for( uint l = 0; l < def->req(); l++ ) {
 916                 if (n == def->in(l)) {
 917                   is_loop = true;
 918                   break; // Some kind of loop
 919                 }
 920               }
 921             }
 922             assert( is_loop || b->find_node(def) < j, "uses must follow definitions" );
 923           }
 924           if( def->is_SafePointScalarObject() ) {
 925             assert(_bbs[def->_idx] == b, "SafePointScalarObject Node should be at the same block as its SafePoint node");
 926             assert(_bbs[def->_idx] == _bbs[def->in(0)->_idx], "SafePointScalarObject Node should be at the same block as its control edge");
 927           }
 928         }
 929       }
 930     }
 931 
 932     j = b->end_idx();
 933     Node *bp = (Node*)b->_nodes[b->_nodes.size()-1]->is_block_proj();
 934     assert( bp, "last instruction must be a block proj" );
 935     assert( bp == b->_nodes[j], "wrong number of successors for this block" );
 936     if( bp->is_Catch() ) {
 937       while( b->_nodes[--j]->Opcode() == Op_MachProj ) ;
 938       assert( b->_nodes[j]->is_Call(), "CatchProj must follow call" );
 939     }
 940     else if( bp->is_Mach() && bp->as_Mach()->ideal_Opcode() == Op_If ) {
 941       assert( b->_num_succs == 2, "Conditional branch must have two targets");
 942     }
 943   }


src/share/vm/opto/block.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File