src/share/vm/opto/parse2.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/parse2.cpp	Thu Nov 13 12:03:13 2014
--- new/src/share/vm/opto/parse2.cpp	Thu Nov 13 12:03:13 2014

*** 1014,1023 **** --- 1014,1040 ---- float cnt; float prob = branch_prediction(cnt, btest, target_bci); float untaken_prob = 1.0 - prob; + // Generate branch to block which trows exception or traps + // instead of generating separate uncommon traps for each + // such branch. + // It may help to convert several checks into one range check. + if ((branch_block->may_throw() || branch_block->has_trap()) && + (branch_block->num_successors() == 0) && + (prob < PROB_MIN)) { // exit block + prob = PROB_MIN; + untaken_prob = 1.0 - prob; + } + if ((next_block->may_throw() || next_block->has_trap()) && + (next_block->num_successors() == 0) && + (untaken_prob < PROB_MIN)) { // exit block + untaken_prob = PROB_MIN; + prob = 1.0 - untaken_prob; + } + if (prob == PROB_UNKNOWN) { #ifndef PRODUCT if (PrintOpto && Verbose) tty->print_cr("Never-taken edge stops compilation at bci %d",bci()); #endif

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