diff src/share/vm/opto/parse1.cpp @ 4777:e9a5e0a812c8

7125896: Eliminate nested locks Summary: Nested locks elimination done before lock nodes expansion by looking for outer locks of the same object. Reviewed-by: never, twisti
author kvn
date Sat, 07 Jan 2012 13:26:43 -0800
parents 069ab3f976d3
children b0ff910edfc9
line wrap: on
line diff
--- a/src/share/vm/opto/parse1.cpp	Sat Jan 07 10:39:23 2012 -0800
+++ b/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 {