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