# HG changeset patch # User Christian Humer # Date 1412346168 -7200 # Node ID 7b6e829e995ad2576badb3454ee58d8ba8e45ec3 # Parent 106f7821995530b28ca212e9200351451cabc9d4 Truffle: improve inlining performance warnings. diff -r 106f78219955 -r 7b6e829e995a graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedDirectCallNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedDirectCallNode.java Fri Oct 03 15:16:31 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedDirectCallNode.java Fri Oct 03 16:22:48 2014 +0200 @@ -206,4 +206,9 @@ splittingStrategy.forceSplitting(); return true; } + + @Override + public String toString() { + return String.format("OptimizedDirectCallNode(target=%s, parent=%s)", getCurrentCallTarget().toString(), getParent()); + } } diff -r 106f78219955 -r 7b6e829e995a graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Fri Oct 03 15:16:31 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Fri Oct 03 16:22:48 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.truffle; import static com.oracle.graal.compiler.common.GraalOptions.*; +import static com.oracle.graal.truffle.OptimizedCallTargetLog.*; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.util.*; @@ -59,9 +60,6 @@ import com.oracle.graal.virtual.phases.ea.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.nodes.*; -import com.oracle.truffle.api.nodes.Node.Child; -import com.oracle.truffle.api.nodes.Node.Children; -import static com.oracle.graal.truffle.OptimizedCallTargetLog.*; /** * Class performing the partial evaluation starting from the root node of an AST. @@ -296,8 +294,9 @@ InliningDecision decision = inlining.findByCall(callNode); if (decision == null) { if (TruffleCompilerOptions.PrintTrufflePerformanceWarnings.getValue()) { - logPerformanceWarning(String.format("%s '%s' is reached using partial evaluation but it is not reachable in the Truffle AST. Did you miss @%s or @%s annotation on a node field?. ", - DirectCallNode.class.getSimpleName(), callNode, Child.class.getSimpleName(), Children.class.getSimpleName()), callNode.getRootNode().getDebugProperties()); + Map properties = new LinkedHashMap<>(); + properties.put("callNode", callNode); + logPerformanceWarning("A direct call within the Truffle AST is not reachable anymore. Call node was not inlined.", properties); } return null; } @@ -307,9 +306,10 @@ OptimizedCallTarget currentTarget = decision.getProfile().getCallNode().getCurrentCallTarget(); if (decision.getTarget() != currentTarget) { if (TruffleCompilerOptions.PrintTrufflePerformanceWarnings.getValue()) { - logPerformanceWarning( - String.format("CallTarget '%s' changed to '%s' during compilation for call node '%s'. Call node was not inlined.", decision.getTarget(), currentTarget, callNode), null); - + Map properties = new LinkedHashMap<>(); + properties.put("originalTarget", decision.getTarget()); + properties.put("callNode", callNode); + logPerformanceWarning(String.format("CallTarget changed during compilation. Call node was not inlined."), properties); } return null; }