hotspot/src/share/vm/opto/phaseX.cpp
changeset 6752 9a3b09fd5745
parent 5901 c046f8e9c52b
child 7397 5b173b4ca846
equal deleted inserted replaced
6751:b399fd234e47 6752:9a3b09fd5745
   842       _verify_window[i] = NULL;
   842       _verify_window[i] = NULL;
   843     }
   843     }
   844   }
   844   }
   845 #endif
   845 #endif
   846 
   846 
       
   847 #ifdef ASSERT
       
   848   Node* prev = NULL;
       
   849   uint rep_cnt = 0;
       
   850 #endif
       
   851   uint loop_count = 0;
       
   852 
   847   // Pull from worklist; transform node;
   853   // Pull from worklist; transform node;
   848   // If node has changed: update edge info and put uses on worklist.
   854   // If node has changed: update edge info and put uses on worklist.
   849   while( _worklist.size() ) {
   855   while( _worklist.size() ) {
   850     Node *n  = _worklist.pop();
   856     Node *n  = _worklist.pop();
       
   857     if (++loop_count >= K * C->unique()) {
       
   858       debug_only(n->dump(4);)
       
   859       assert(false, "infinite loop in PhaseIterGVN::optimize");
       
   860       C->record_method_not_compilable("infinite loop in PhaseIterGVN::optimize");
       
   861       return;
       
   862     }
       
   863 #ifdef ASSERT
       
   864     if (n == prev) {
       
   865       if (++rep_cnt > 3) {
       
   866         n->dump(4);
       
   867         assert(false, "loop in Ideal transformation");
       
   868       }
       
   869     } else {
       
   870       rep_cnt = 0;
       
   871     }
       
   872     prev = n;
       
   873 #endif
   851     if (TraceIterativeGVN && Verbose) {
   874     if (TraceIterativeGVN && Verbose) {
   852       tty->print("  Pop ");
   875       tty->print("  Pop ");
   853       NOT_PRODUCT( n->dump(); )
   876       NOT_PRODUCT( n->dump(); )
   854       debug_only(if( (num_processed++ % 100) == 0 ) _worklist.print_set();)
   877       debug_only(if( (num_processed++ % 100) == 0 ) _worklist.print_set();)
   855     }
   878     }