< prev index next >

src/share/vm/ci/ciTypeFlow.cpp

Print this page


   1 /*
   2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


2175     case Bytecodes::_ldc:
2176     case Bytecodes::_ldc_w:
2177     case Bytecodes::_ldc2_w:
2178     case Bytecodes::_aload_0:
2179       // These bytecodes can trap for rewriting.  We need to assume that
2180       // they do not throw exceptions to make the monitor analysis work.
2181       return false;
2182 
2183     case Bytecodes::_ireturn:
2184     case Bytecodes::_lreturn:
2185     case Bytecodes::_freturn:
2186     case Bytecodes::_dreturn:
2187     case Bytecodes::_areturn:
2188     case Bytecodes::_return:
2189       // We can assume the monitor stack is empty in this analysis.
2190       return false;
2191 
2192     case Bytecodes::_monitorexit:
2193       // We can assume monitors are matched in this analysis.
2194       return false;
2195   }
2196 

2197   return true;

2198 }
2199 
2200 // ------------------------------------------------------------------
2201 // ciTypeFlow::clone_loop_heads
2202 //
2203 // Clone the loop heads
2204 bool ciTypeFlow::clone_loop_heads(Loop* lp, StateVector* temp_vector, JsrSet* temp_set) {
2205   bool rslt = false;
2206   for (PreorderLoops iter(loop_tree_root()); !iter.done(); iter.next()) {
2207     lp = iter.current();
2208     Block* head = lp->head();
2209     if (lp == loop_tree_root() ||
2210         lp->is_irreducible() ||
2211         !head->is_clonable_exit(lp))
2212       continue;
2213 
2214     // Avoid BoxLock merge.
2215     if (EliminateNestedLocks && head->has_monitorenter())
2216       continue;
2217 


   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


2175     case Bytecodes::_ldc:
2176     case Bytecodes::_ldc_w:
2177     case Bytecodes::_ldc2_w:
2178     case Bytecodes::_aload_0:
2179       // These bytecodes can trap for rewriting.  We need to assume that
2180       // they do not throw exceptions to make the monitor analysis work.
2181       return false;
2182 
2183     case Bytecodes::_ireturn:
2184     case Bytecodes::_lreturn:
2185     case Bytecodes::_freturn:
2186     case Bytecodes::_dreturn:
2187     case Bytecodes::_areturn:
2188     case Bytecodes::_return:
2189       // We can assume the monitor stack is empty in this analysis.
2190       return false;
2191 
2192     case Bytecodes::_monitorexit:
2193       // We can assume monitors are matched in this analysis.
2194       return false;

2195 
2196     default:
2197       return true;
2198   }
2199 }
2200 
2201 // ------------------------------------------------------------------
2202 // ciTypeFlow::clone_loop_heads
2203 //
2204 // Clone the loop heads
2205 bool ciTypeFlow::clone_loop_heads(Loop* lp, StateVector* temp_vector, JsrSet* temp_set) {
2206   bool rslt = false;
2207   for (PreorderLoops iter(loop_tree_root()); !iter.done(); iter.next()) {
2208     lp = iter.current();
2209     Block* head = lp->head();
2210     if (lp == loop_tree_root() ||
2211         lp->is_irreducible() ||
2212         !head->is_clonable_exit(lp))
2213       continue;
2214 
2215     // Avoid BoxLock merge.
2216     if (EliminateNestedLocks && head->has_monitorenter())
2217       continue;
2218 


< prev index next >