# HG changeset patch # User Lukas Stadler # Date 1352300351 -3600 # Node ID 10a3d06d58dced4b179e76a3679e50807ea52038 # Parent 4f28522d9cfdd5dee02af176aed2f7cdc0457ab5 fix for unnecessary BailoutExceptions in OSR diff -r 4f28522d9cfd -r 10a3d06d58dc graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Wed Nov 07 15:58:20 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Wed Nov 07 15:59:11 2012 +0100 @@ -42,20 +42,22 @@ @Override protected void run(StructuredGraph graph) { + if (graph.getEntryBCI() == StructuredGraph.INVOCATION_ENTRY_BCI) { + // This happens during inlining in a OSR method, because the same phase plan will be used. + return; + } Debug.dump(graph, "OnStackReplacement initial"); EntryMarkerNode osr; do { NodeIterable osrNodes = graph.getNodes(EntryMarkerNode.class); osr = osrNodes.first(); if (osr == null) { - System.out.println("no OnStackReplacementNode generated"); throw new BailoutException("no OnStackReplacementNode generated"); } if (osrNodes.count() > 1) { throw new GraalInternalError("multiple OnStackReplacementNodes generated"); } if (osr.stateAfter().locksSize() != 0) { - System.out.println("osr with locks not supported"); throw new BailoutException("osr with locks not supported"); } if (osr.stateAfter().stackSize() != 0) {