# HG changeset patch # User Christian Haeubl # Date 1330738997 28800 # Node ID 836e4fce33ab151ea82e69c8d38c4bb7135c0f98 # Parent bf63d72879aa6da7a61ea31331a89d3ae9b0debb changed inlining debug output diff -r bf63d72879aa -r 836e4fce33ab graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Fri Mar 02 16:44:36 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Fri Mar 02 17:43:17 2012 -0800 @@ -85,32 +85,31 @@ while (!inlineCandidates.isEmpty() && graph.getNodeCount() < GraalOptions.MaximumDesiredSize) { InlineInfo info = inlineCandidates.remove(); - if (inliningPolicy.isWorthInlining(graph, info)) { + if (info.invoke.node().isAlive() && inliningPolicy.isWorthInlining(graph, info)) { Iterable newNodes = null; - if (info.invoke.node().isAlive()) { - try { - info.inline(graph, runtime, this); - Debug.dump(graph, "after %s", info); - // get the new nodes here, the canonicalizer phase will reset the mark - newNodes = graph.getNewNodes(); - if (GraalOptions.OptCanonicalizer) { - new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph); - } - if (GraalOptions.Intrinsify) { - new IntrinsificationPhase(runtime).apply(graph); - } - metricInliningPerformed.increment(); - } catch (CiBailout bailout) { - // TODO determine if we should really bail out of the whole compilation. - throw bailout; - } catch (AssertionError e) { - throw new GraalInternalError(e).addContext(info.toString()); - } catch (RuntimeException e) { - throw new GraalInternalError(e).addContext(info.toString()); - } catch (GraalInternalError e) { - throw e.addContext(info.toString()); + try { + info.inline(graph, runtime, this); + Debug.dump(graph, "after %s", info); + // get the new nodes here, the canonicalizer phase will reset the mark + newNodes = graph.getNewNodes(); + if (GraalOptions.OptCanonicalizer) { + new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph); + } + if (GraalOptions.Intrinsify) { + new IntrinsificationPhase(runtime).apply(graph); } + metricInliningPerformed.increment(); + } catch (CiBailout bailout) { + // TODO determine if we should really bail out of the whole compilation. + throw bailout; + } catch (AssertionError e) { + throw new GraalInternalError(e).addContext(info.toString()); + } catch (RuntimeException e) { + throw new GraalInternalError(e).addContext(info.toString()); + } catch (GraalInternalError e) { + throw e.addContext(info.toString()); } + if (newNodes != null && info.level < GraalOptions.MaximumInlineLevel) { scanInvokes(newNodes, info.level + 1, graph); } diff -r bf63d72879aa -r 836e4fce33ab graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Fri Mar 02 16:44:36 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Fri Mar 02 17:43:17 2012 -0800 @@ -187,8 +187,6 @@ graph.addBeforeFixed(invoke.node(), guard); graph.addBeforeFixed(invoke.node(), anchor); - Debug.log("inlining 1 method using 1 type check"); - StructuredGraph calleeGraph = getGraph(concrete, callback); assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime); callback.recordMethodContentsAssumption(concrete); @@ -251,8 +249,6 @@ } else { inlineSingleMethod(graph, runtime, callback); } - - Debug.log("inlining %d methods with %d type checks and falling back to %s if violated", numberOfMethods, types.length, shouldFallbackToInvoke() ? "invocation" : "deoptimization"); } private boolean shouldFallbackToInvoke() { @@ -487,7 +483,8 @@ @Override public String toString() { - StringBuilder builder = new StringBuilder(String.format("inlining %d methods with %d type checks: ", concretes.size(), types.length)); + StringBuilder builder = new StringBuilder(shouldFallbackToInvoke() ? "megamorphic" : "polymorphic"); + builder.append(String.format(" inlining %d methods with %d type checks: ", concretes.size(), types.length)); for (int i = 0; i < concretes.size(); i++) { builder.append(CiUtil.format(" %H.%n(%p):%r", concretes.get(i))); } @@ -661,7 +658,11 @@ return null; } } else { - Debug.log("not inlining %s because GraalOptions.InlineMonomorphicCalls == false", methodName(targetMethod, invoke)); + if (!GraalOptions.InlinePolymorphicCalls && notRecordedTypeProbability == 0) { + Debug.log("not inlining %s because GraalOptions.InlinePolymorphicCalls == false", methodName(targetMethod, invoke)); + } else { + Debug.log("not inlining %s because GraalOptions.InlineMegamorphicCalls == false", methodName(targetMethod, invoke)); + } return null; } } diff -r bf63d72879aa -r 836e4fce33ab graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java Fri Mar 02 16:44:36 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java Fri Mar 02 17:43:17 2012 -0800 @@ -290,7 +290,7 @@ // java.util.concurrent.BlockingQueue is used to implement the compilation worker // queues. If a compiler thread triggers a compilation, then it may be blocked trying // to add something to its own queue. - return false; + return true; } }