hotspot/src/share/vm/opto/gcm.cpp
changeset 781 e1baa9c8f16f
parent 670 ddf3e9583f2f
parent 761 312de898447e
child 1070 e03de091796e
equal deleted inserted replaced
743:b8b10c2a28fd 781:e1baa9c8f16f
   305     Block* mid = worklist.pop();
   305     Block* mid = worklist.pop();
   306     if (mid == early)  continue;  // stop searching here
   306     if (mid == early)  continue;  // stop searching here
   307 
   307 
   308     // Test and set the visited bit.
   308     // Test and set the visited bit.
   309     if (mid->raise_LCA_visited() == mark)  continue;  // already visited
   309     if (mid->raise_LCA_visited() == mark)  continue;  // already visited
   310     mid->set_raise_LCA_visited(mark);
       
   311 
   310 
   312     // Don't process the current LCA, otherwise the search may terminate early
   311     // Don't process the current LCA, otherwise the search may terminate early
   313     if (mid != LCA && mid->raise_LCA_mark() == mark) {
   312     if (mid != LCA && mid->raise_LCA_mark() == mark) {
   314       // Raise the LCA.
   313       // Raise the LCA.
   315       LCA = mid->dom_lca(LCA);
   314       LCA = mid->dom_lca(LCA);
   316       if (LCA == early)  break;   // stop searching everywhere
   315       if (LCA == early)  break;   // stop searching everywhere
   317       assert(early->dominates(LCA), "early is high enough");
   316       assert(early->dominates(LCA), "early is high enough");
   318       // Resume searching at that point, skipping intermediate levels.
   317       // Resume searching at that point, skipping intermediate levels.
   319       worklist.push(LCA);
   318       worklist.push(LCA);
       
   319       if (LCA == mid)
       
   320         continue; // Don't mark as visited to avoid early termination.
   320     } else {
   321     } else {
   321       // Keep searching through this block's predecessors.
   322       // Keep searching through this block's predecessors.
   322       for (uint j = 1, jmax = mid->num_preds(); j < jmax; j++) {
   323       for (uint j = 1, jmax = mid->num_preds(); j < jmax; j++) {
   323         Block* mid_parent = bbs[ mid->pred(j)->_idx ];
   324         Block* mid_parent = bbs[ mid->pred(j)->_idx ];
   324         worklist.push(mid_parent);
   325         worklist.push(mid_parent);
   325       }
   326       }
   326     }
   327     }
       
   328     mid->set_raise_LCA_visited(mark);
   327   }
   329   }
   328   return LCA;
   330   return LCA;
   329 }
   331 }
   330 
   332 
   331 //--------------------------memory_early_block--------------------------------
   333 //--------------------------memory_early_block--------------------------------