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 Jan 7 16:01:57 2010
--- new/src/share/vm/opto/parse2.cpp Thu Jan 7 16:01:57 2010
*** 276,285 ****
--- 276,290 ----
int len = hi_index - lo_index + 1;
if (len < 1) {
// If this is a backward branch, add safepoint
maybe_add_safepoint(default_dest);
+ if(should_add_predicate(default_dest)){
+ _sp += 1; //set original stack for use by uncommon_trap
+ add_predicate();
+ _sp -= 1;
+ }
merge(default_dest);
return;
}
// generate decision tree, using trichotomy when possible
*** 322,331 ****
--- 327,341 ----
int default_dest = iter().get_dest_table(0);
int len = iter().get_int_table(1);
if (len < 1) { // If this is a backward branch, add safepoint
maybe_add_safepoint(default_dest);
+ if(should_add_predicate(default_dest)){
+ _sp += 1; //set original stack for use by uncommon_trap
+ add_predicate();
+ _sp -= 1;
+ }
merge(default_dest);
return;
}
// generate decision tree, using trichotomy when possible
*** 729,738 ****
--- 739,751 ----
// Effect on jsr on stack
push(_gvn.makecon(ret_addr));
// Flow to the jsr.
+ if(should_add_predicate(jsr_bci)){
+ add_predicate();
+ }
merge(jsr_bci);
}
// Handle ret bytecode
void Parse::do_ret() {
*** 879,889 ****
--- 892,902 ----
return prob < PROB_MIN;
}
//-------------------------------repush_if_args--------------------------------
// Push arguments of an "if" bytecode back onto the stack by adjusting _sp.
! inline void Parse::repush_if_args() {
! inline int Parse::repush_if_args() {
#ifndef PRODUCT
if (PrintOpto && WizardMode) {
tty->print("defending against excessive implicit null exceptions on %s @%d in ",
Bytecodes::name(iter().cur_bc()), iter().cur_bci());
method()->print_name(); tty->cr();
*** 893,902 ****
--- 906,916 ----
assert(bc_depth == 1 || bc_depth == 2, "only two kinds of branches");
DEBUG_ONLY(sync_jvms()); // argument(n) requires a synced jvms
assert(argument(0) != NULL, "must exist");
assert(bc_depth == 1 || argument(1) != NULL, "two must exist");
_sp += bc_depth;
+ return bc_depth;
}
//----------------------------------do_ifnull----------------------------------
void Parse::do_ifnull(BoolTest::mask btest, Node *c) {
int target_bci = iter().get_dest();
*** 952,965 ****
--- 966,985 ----
}
} else { // Path is live.
// Update method data
profile_taken_branch(target_bci);
adjust_map_after_if(btest, c, prob, branch_block, next_block);
! if (!stopped()) {
+ if(should_add_predicate(target_bci)){//add a predicate if it branches to a loop
+ int nargs = repush_if_args();//set original stack for uncommon_trap
+ add_predicate();
+ _sp -= nargs;
+ }
merge(target_bci);
}
}
+ }
// False branch
Node* iffalse = _gvn.transform( new (C, 1) IfFalseNode(iff) );
set_control(iffalse);
*** 1074,1087 ****
--- 1094,1113 ----
}
} else {
// Update method data
profile_taken_branch(target_bci);
adjust_map_after_if(taken_btest, c, prob, branch_block, next_block);
! if (!stopped()) {
+ if(should_add_predicate(target_bci)){//add a predicate if it branches to a loop
+ int nargs = repush_if_args(); //set original stack for the uncommon_trap
+ add_predicate();
+ _sp -= nargs;
+ }
merge(target_bci);
}
}
+ }
untaken_branch = _gvn.transform(untaken_branch);
set_control(untaken_branch);
// Branch not taken.
*** 2078,2087 ****
--- 2104,2117 ----
maybe_add_safepoint(target_bci);
// Update method data
profile_taken_branch(target_bci);
+ //Add loop predicate if it goes to a loop
+ if(should_add_predicate(target_bci)){
+ add_predicate();
+ }
// Merge the current control into the target basic block
merge(target_bci);
// See if we can get some profile data and hand it off to the next block
Block *target_block = block()->successor_for_bci(target_bci);
src/share/vm/opto/parse2.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File