6851386: assert(b->find_node(def) < j,"uses must follow definitions")
authorkvn
Sun, 26 Jul 2009 12:59:41 -0700
changeset 3593 51f613a50db6
parent 3592 857575a0a200
child 3594 0ce9158bc84c
6851386: assert(b->find_node(def) < j,"uses must follow definitions") Summary: Add additional check for a tight loop. Reviewed-by: never
hotspot/src/share/vm/opto/block.cpp
--- a/hotspot/src/share/vm/opto/block.cpp	Fri Jul 24 12:40:40 2009 -0700
+++ b/hotspot/src/share/vm/opto/block.cpp	Sun Jul 26 12:59:41 2009 -0700
@@ -910,7 +910,16 @@
               !(b->head()->is_Loop() && n->is_Phi()) &&
               // See (+++) comment in reg_split.cpp
               !(n->jvms() != NULL && n->jvms()->is_monitor_use(k)) ) {
-            assert( b->find_node(def) < j, "uses must follow definitions" );
+            bool is_loop = false;
+            if (n->is_Phi()) {
+              for( uint l = 1; l < def->req(); l++ ) {
+                if (n == def->in(l)) {
+                  is_loop = true;
+                  break; // Some kind of loop
+                }
+              }
+            }
+            assert( is_loop || b->find_node(def) < j, "uses must follow definitions" );
           }
           if( def->is_SafePointScalarObject() ) {
             assert(_bbs[def->_idx] == b, "SafePointScalarObject Node should be at the same block as its SafePoint node");