7125896: Eliminate nested locks

Nested locks elimination done before lock nodes expansion by looking for outer locks of the same object.

Reviewed-by: never, twisti
This commit is contained in:
Vladimir Kozlov 2012-01-07 13:26:43 -08:00
parent f99fb50071
commit 94927c382b
17 changed files with 366 additions and 145 deletions

View file

@ -1819,8 +1819,12 @@ PhiNode *Parse::ensure_phi(int idx, bool nocreate) {
} else if (jvms->is_stk(idx)) {
t = block()->stack_type_at(idx - jvms->stkoff());
} else if (jvms->is_mon(idx)) {
assert(!jvms->is_monitor_box(idx), "no phis for boxes");
t = TypeInstPtr::BOTTOM; // this is sufficient for a lock object
if (EliminateNestedLocks && jvms->is_monitor_box(idx)) {
// BoxLock nodes are not commoning. Create Phi.
t = o->bottom_type(); // TypeRawPtr::BOTTOM
} else {
t = TypeInstPtr::BOTTOM; // this is sufficient for a lock object
}
} else if ((uint)idx < TypeFunc::Parms) {
t = o->bottom_type(); // Type::RETURN_ADDRESS or such-like.
} else {