Mercurial > hg > truffle
comparison src/share/vm/c1/c1_IR.cpp @ 428:334969144810
6758445: loop heads that are exception entry points can crash during count_edges/mark_loops
Reviewed-by: kvn, jrose
author | never |
---|---|
date | Tue, 11 Nov 2008 23:03:35 -0800 |
parents | a61af66fc99e |
children | ad8c8ca4ab0f |
comparison
equal
deleted
inserted
replaced
421:577f3a2e0662 | 428:334969144810 |
---|---|
572 | 572 |
573 if (is_active(cur)) { | 573 if (is_active(cur)) { |
574 TRACE_LINEAR_SCAN(3, tty->print_cr("backward branch")); | 574 TRACE_LINEAR_SCAN(3, tty->print_cr("backward branch")); |
575 assert(is_visited(cur), "block must be visisted when block is active"); | 575 assert(is_visited(cur), "block must be visisted when block is active"); |
576 assert(parent != NULL, "must have parent"); | 576 assert(parent != NULL, "must have parent"); |
577 assert(parent->number_of_sux() == 1, "loop end blocks must have one successor (critical edges are split)"); | |
578 | 577 |
579 cur->set(BlockBegin::linear_scan_loop_header_flag); | 578 cur->set(BlockBegin::linear_scan_loop_header_flag); |
580 cur->set(BlockBegin::backward_branch_target_flag); | 579 cur->set(BlockBegin::backward_branch_target_flag); |
581 | 580 |
582 parent->set(BlockBegin::linear_scan_loop_end_flag); | 581 parent->set(BlockBegin::linear_scan_loop_end_flag); |
582 | |
583 // When a loop header is also the start of an exception handler, then the backward branch is | |
584 // an exception edge. Because such edges are usually critical edges which cannot be split, the | |
585 // loop must be excluded here from processing. | |
586 if (cur->is_set(BlockBegin::exception_entry_flag)) { | |
587 // Make sure that dominators are correct in this weird situation | |
588 _iterative_dominators = true; | |
589 return; | |
590 } | |
591 assert(parent->number_of_sux() == 1 && parent->sux_at(0) == cur, | |
592 "loop end blocks must have one successor (critical edges are split)"); | |
593 | |
583 _loop_end_blocks.append(parent); | 594 _loop_end_blocks.append(parent); |
584 return; | 595 return; |
585 } | 596 } |
586 | 597 |
587 // increment number of incoming forward branches | 598 // increment number of incoming forward branches |