3394 assert(rs < BitsPerInt, "recode bit map"); 3395 if (!too_many_traps((Deoptimization::DeoptReason) rs)) { 3396 _allowed_reasons |= nth_bit(rs); 3397 } 3398 } 3399 } 3400 } 3401 3402 #ifndef PRODUCT 3403 //------------------------------verify_graph_edges--------------------------- 3404 // Walk the Graph and verify that there is a one-to-one correspondence 3405 // between Use-Def edges and Def-Use edges in the graph. 3406 void Compile::verify_graph_edges(bool no_dead_code) { 3407 if (VerifyGraphEdges) { 3408 ResourceArea *area = Thread::current()->resource_area(); 3409 Unique_Node_List visited(area); 3410 // Call recursive graph walk to check edges 3411 _root->verify_edges(visited); 3412 if (no_dead_code) { 3413 // Now make sure that no visited node is used by an unvisited node. 3414 bool dead_nodes = 0; 3415 Unique_Node_List checked(area); 3416 while (visited.size() > 0) { 3417 Node* n = visited.pop(); 3418 checked.push(n); 3419 for (uint i = 0; i < n->outcnt(); i++) { 3420 Node* use = n->raw_out(i); 3421 if (checked.member(use)) continue; // already checked 3422 if (visited.member(use)) continue; // already in the graph 3423 if (use->is_Con()) continue; // a dead ConNode is OK 3424 // At this point, we have found a dead node which is DU-reachable. 3425 if (dead_nodes++ == 0) 3426 tty->print_cr("*** Dead nodes reachable via DU edges:"); 3427 use->dump(2); 3428 tty->print_cr("---"); 3429 checked.push(use); // No repeats; pretend it is now checked. 3430 } 3431 } 3432 assert(dead_nodes == 0, "using nodes must be reachable from root"); 3433 } 3434 } 3435 } 3436 3437 // Verify GC barriers consistency 3438 // Currently supported: 3439 // - G1 pre-barriers (see GraphKit::g1_write_barrier_pre()) 3440 void Compile::verify_barriers() { 3441 if (UseG1GC) { 3442 // Verify G1 pre-barriers 3443 const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active()); 3444 3445 ResourceArea *area = Thread::current()->resource_area(); 3446 Unique_Node_List visited(area); 3447 Node_List worklist(area); 3448 // We're going to walk control flow backwards starting from the Root 3449 worklist.push(_root); 3450 while (worklist.size() > 0) { 3451 Node* x = worklist.pop(); 3452 if (x == NULL || x == top()) continue; | 3394 assert(rs < BitsPerInt, "recode bit map"); 3395 if (!too_many_traps((Deoptimization::DeoptReason) rs)) { 3396 _allowed_reasons |= nth_bit(rs); 3397 } 3398 } 3399 } 3400 } 3401 3402 #ifndef PRODUCT 3403 //------------------------------verify_graph_edges--------------------------- 3404 // Walk the Graph and verify that there is a one-to-one correspondence 3405 // between Use-Def edges and Def-Use edges in the graph. 3406 void Compile::verify_graph_edges(bool no_dead_code) { 3407 if (VerifyGraphEdges) { 3408 ResourceArea *area = Thread::current()->resource_area(); 3409 Unique_Node_List visited(area); 3410 // Call recursive graph walk to check edges 3411 _root->verify_edges(visited); 3412 if (no_dead_code) { 3413 // Now make sure that no visited node is used by an unvisited node. 3414 bool dead_nodes = false; 3415 Unique_Node_List checked(area); 3416 while (visited.size() > 0) { 3417 Node* n = visited.pop(); 3418 checked.push(n); 3419 for (uint i = 0; i < n->outcnt(); i++) { 3420 Node* use = n->raw_out(i); 3421 if (checked.member(use)) continue; // already checked 3422 if (visited.member(use)) continue; // already in the graph 3423 if (use->is_Con()) continue; // a dead ConNode is OK 3424 // At this point, we have found a dead node which is DU-reachable. 3425 if (!dead_nodes) { 3426 tty->print_cr("*** Dead nodes reachable via DU edges:"); 3427 dead_nodes = true; 3428 } 3429 use->dump(2); 3430 tty->print_cr("---"); 3431 checked.push(use); // No repeats; pretend it is now checked. 3432 } 3433 } 3434 assert(!dead_nodes, "using nodes must be reachable from root"); 3435 } 3436 } 3437 } 3438 3439 // Verify GC barriers consistency 3440 // Currently supported: 3441 // - G1 pre-barriers (see GraphKit::g1_write_barrier_pre()) 3442 void Compile::verify_barriers() { 3443 if (UseG1GC) { 3444 // Verify G1 pre-barriers 3445 const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active()); 3446 3447 ResourceArea *area = Thread::current()->resource_area(); 3448 Unique_Node_List visited(area); 3449 Node_List worklist(area); 3450 // We're going to walk control flow backwards starting from the Root 3451 worklist.push(_root); 3452 while (worklist.size() > 0) { 3453 Node* x = worklist.pop(); 3454 if (x == NULL || x == top()) continue; |