< prev index next >

src/hotspot/share/opto/loopUnswitch.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -27,10 +27,14 @@
 #include "opto/connode.hpp"
 #include "opto/convertnode.hpp"
 #include "opto/loopnode.hpp"
 #include "opto/opaquenode.hpp"
 #include "opto/rootnode.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_SHENANDOAHGC
+#include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
+#endif
 
 //================= Loop Unswitching =====================
 //
 // orig:                       transformed:
 //                               if (invariant-test) then

@@ -52,11 +56,11 @@
 // Note: the "else" clause may be empty
 
 //------------------------------policy_unswitching-----------------------------
 // Return TRUE or FALSE if the loop should be unswitched
 // (ie. clone loop with an invariant test that does not exit the loop)
-bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const {
+bool IdealLoopTree::policy_unswitching(PhaseIdealLoop *phase) const {
   if( !LoopUnswitching ) {
     return false;
   }
   if (!_head->is_Loop()) {
     return false;

@@ -84,10 +88,11 @@
 
   // Find first invariant test that doesn't exit the loop
   LoopNode *head = loop->_head->as_Loop();
   IfNode* unswitch_iff = NULL;
   Node* n = head->in(LoopNode::LoopBackControl);
+  int loop_has_sfpts = -1;
   while (n != head) {
     Node* n_dom = idom(n);
     if (n->is_Region()) {
       if (n_dom->is_If()) {
         IfNode* iff = n_dom->as_If();

@@ -110,11 +115,11 @@
 
 //------------------------------do_unswitching-----------------------------
 // Clone loop with an invariant test (that does not exit) and
 // insert a clone of the test that selects which version to
 // execute.
-void PhaseIdealLoop::do_unswitching (IdealLoopTree *loop, Node_List &old_new) {
+void PhaseIdealLoop::do_unswitching(IdealLoopTree *loop, Node_List &old_new) {
 
   // Find first invariant test that doesn't exit the loop
   LoopNode *head = loop->_head->as_Loop();
 
   IfNode* unswitch_iff = find_unswitching_candidate((const IdealLoopTree *)loop);
< prev index next >