diff src/share/vm/opto/locknode.cpp @ 4790:b0ff910edfc9

7128355: assert(!nocreate) failed: Cannot build a phi for a block already parsed Summary: Do not common BoxLock nodes and avoid creating phis of boxes. Reviewed-by: never
author kvn
date Thu, 12 Jan 2012 14:45:04 -0800
parents 35acf8f0a2e4
children 89d0a5d40008
line wrap: on
line diff
--- a/src/share/vm/opto/locknode.cpp	Thu Jan 12 12:28:59 2012 -0800
+++ b/src/share/vm/opto/locknode.cpp	Thu Jan 12 14:45:04 2012 -0800
@@ -63,7 +63,7 @@
 }
 
 BoxLockNode* BoxLockNode::box_node(Node* box) {
-  // Chase down the BoxNode
+  // Chase down the BoxNode after RA which may spill box nodes.
   while (!box->is_BoxLock()) {
     //    if (box_node->is_SpillCopy()) {
     //      Node *m = box_node->in(1);
@@ -84,18 +84,13 @@
   return box_node(box)->in_RegMask(0).find_first_elem();
 }
 
-bool BoxLockNode::same_slot(Node* box1, Node* box2) {
-  return box_node(box1)->_slot == box_node(box2)->_slot;
-}
-
 // Is BoxLock node used for one simple lock region (same box and obj)?
 bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) {
   LockNode* lock = NULL;
   bool has_one_lock = false;
   for (uint i = 0; i < this->outcnt(); i++) {
     Node* n = this->raw_out(i);
-    if (n->is_Phi())
-      return false; // Merged regions
+    assert(!n->is_Phi(), "should not merge BoxLock nodes");
     if (n->is_AbstractLock()) {
       AbstractLockNode* alock = n->as_AbstractLock();
       // Check lock's box since box could be referenced by Lock's debug info.
@@ -135,7 +130,19 @@
           Node* obj_node = sfn->monitor_obj(jvms, idx);
           Node* box_node = sfn->monitor_box(jvms, idx);
           if (box_node == this) {
-            assert(obj_node->eqv_uncast(obj),"");
+            if (!obj_node->eqv_uncast(obj)) {
+              tty->cr();
+              tty->print_cr("=====monitor info has different obj=====");
+              tty->print_cr("obj:");
+              obj->dump(1); tty->cr();
+              tty->print_cr("obj uncast:");
+              obj->uncast()->dump(); tty->cr();
+              tty->print_cr("obj_node:");
+              obj_node->dump(1); tty->cr();
+              tty->print_cr("obj_node uncast:");
+              obj_node->uncast()->dump();
+            }
+            assert(obj_node->eqv_uncast(obj),"monitor info has different obj");
           }
         }
       }