changeset 5106:cfea5eeb3a76

8040664: Revert temporary fix JDK-8038785 Reviewed-by: kvn
author sgabdura
date Fri, 18 Apr 2014 08:08:05 +0200
parents 073b9c2f9afa
children 3a2cedafb805
files src/share/vm/opto/parse1.cpp
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/parse1.cpp	Tue Apr 22 18:11:40 2014 -0700
+++ b/src/share/vm/opto/parse1.cpp	Fri Apr 18 08:08:05 2014 +0200
@@ -638,6 +638,25 @@
         // (Note that dead locals do not get phis built, ever.)
         ensure_phis_everywhere();
 
+        if (block->is_SEL_head() &&
+            (UseLoopPredicate || LoopLimitCheck)) {
+          // Add predicate to single entry (not irreducible) loop head.
+          assert(!block->has_merged_backedge(), "only entry paths should be merged for now");
+          // Need correct bci for predicate.
+          // It is fine to set it here since do_one_block() will set it anyway.
+          set_parse_bci(block->start());
+          add_predicate();
+          // Add new region for back branches.
+          int edges = block->pred_count() - block->preds_parsed() + 1; // +1 for original region
+          RegionNode *r = new (C) RegionNode(edges+1);
+          _gvn.set_type(r, Type::CONTROL);
+          record_for_igvn(r);
+          r->init_req(edges, control());
+          set_control(r);
+          // Add new phis.
+          ensure_phis_everywhere();
+        }
+
         // Leave behind an undisturbed copy of the map, for future merges.
         set_map(clone_map());
       }
@@ -1501,6 +1520,11 @@
       set_parse_bci(target->start()); // Set target bci
       if (target->is_SEL_head()) {
         DEBUG_ONLY( target->mark_merged_backedge(block()); )
+        if (target->start() == 0) {
+          // Add loop predicate for the special case when
+          // there are backbranches to the method entry.
+          add_predicate();
+        }
       }
       // Add a Region to start the new basic block.  Phis will be added
       // later lazily.