1195 Block* block = get_block(i);
1196 if (block != NULL) {
1197 block->dump_head(this);
1198 }
1199 }
1200 }
1201
1202 void PhaseCFG::verify() const {
1203 #ifdef ASSERT
1204 // Verify sane CFG
1205 for (uint i = 0; i < number_of_blocks(); i++) {
1206 Block* block = get_block(i);
1207 uint cnt = block->number_of_nodes();
1208 uint j;
1209 for (j = 0; j < cnt; j++) {
1210 Node *n = block->get_node(j);
1211 assert(get_block_for_node(n) == block, "");
1212 if (j >= 1 && n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_CreateEx) {
1213 assert(j == 1 || block->get_node(j-1)->is_Phi(), "CreateEx must be first instruction in block");
1214 }
1215 for (uint k = 0; k < n->req(); k++) {
1216 Node *def = n->in(k);
1217 if (def && def != n) {
1218 assert(get_block_for_node(def) || def->is_Con(), "must have block; constants for debug info ok");
1219 // Verify that instructions in the block is in correct order.
1220 // Uses must follow their definition if they are at the same block.
1221 // Mostly done to check that MachSpillCopy nodes are placed correctly
1222 // when CreateEx node is moved in build_ifg_physical().
1223 if (get_block_for_node(def) == block && !(block->head()->is_Loop() && n->is_Phi()) &&
1224 // See (+++) comment in reg_split.cpp
1225 !(n->jvms() != NULL && n->jvms()->is_monitor_use(k))) {
1226 bool is_loop = false;
1227 if (n->is_Phi()) {
1228 for (uint l = 1; l < def->req(); l++) {
1229 if (n == def->in(l)) {
1230 is_loop = true;
1231 break; // Some kind of loop
1232 }
1233 }
1234 }
|
1195 Block* block = get_block(i);
1196 if (block != NULL) {
1197 block->dump_head(this);
1198 }
1199 }
1200 }
1201
1202 void PhaseCFG::verify() const {
1203 #ifdef ASSERT
1204 // Verify sane CFG
1205 for (uint i = 0; i < number_of_blocks(); i++) {
1206 Block* block = get_block(i);
1207 uint cnt = block->number_of_nodes();
1208 uint j;
1209 for (j = 0; j < cnt; j++) {
1210 Node *n = block->get_node(j);
1211 assert(get_block_for_node(n) == block, "");
1212 if (j >= 1 && n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_CreateEx) {
1213 assert(j == 1 || block->get_node(j-1)->is_Phi(), "CreateEx must be first instruction in block");
1214 }
1215 if (n->needs_anti_dependence_check()) {
1216 verify_anti_dependences(block, n);
1217 }
1218 for (uint k = 0; k < n->req(); k++) {
1219 Node *def = n->in(k);
1220 if (def && def != n) {
1221 assert(get_block_for_node(def) || def->is_Con(), "must have block; constants for debug info ok");
1222 // Verify that instructions in the block is in correct order.
1223 // Uses must follow their definition if they are at the same block.
1224 // Mostly done to check that MachSpillCopy nodes are placed correctly
1225 // when CreateEx node is moved in build_ifg_physical().
1226 if (get_block_for_node(def) == block && !(block->head()->is_Loop() && n->is_Phi()) &&
1227 // See (+++) comment in reg_split.cpp
1228 !(n->jvms() != NULL && n->jvms()->is_monitor_use(k))) {
1229 bool is_loop = false;
1230 if (n->is_Phi()) {
1231 for (uint l = 1; l < def->req(); l++) {
1232 if (n == def->in(l)) {
1233 is_loop = true;
1234 break; // Some kind of loop
1235 }
1236 }
1237 }
|