--- a/hotspot/src/share/vm/opto/parse1.cpp Sat Jan 07 10:39:23 2012 -0800
+++ b/hotspot/src/share/vm/opto/parse1.cpp Sat Jan 07 13:26:43 2012 -0800
@@ -1819,8 +1819,12 @@
} 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 {