graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Wed Apr 10 13:35:26 2013
--- new/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Wed Apr 10 13:35:26 2013

*** 31,40 **** --- 31,41 ---- import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; import com.oracle.graal.api.meta.ResolvedJavaType.Representation; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; + import com.oracle.graal.hotspot.HotSpotGraalRuntime; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
*** 71,87 **** --- 72,130 ---- void scanInvokes(Iterable<? extends Node> newNodes); boolean isWorthInlining(InlineInfo info); } public static boolean logNotInlinedMethod(InlineInfo info, String msg, Object... args) { + /** + * Print a HotSpot-style inlining message to the console. + */ + private static void printInlining(final InlineInfo info, final boolean success, final String msg, final Object... args) { + printInlining(info.methodAt(0), info.invoke(), success, msg, args); + } + + /** + * Print a HotSpot-style inlining message to the console. + */ + private static void printInlining(final ResolvedJavaMethod method, final Invoke invoke, final boolean success, final String msg, final Object... args) { + if (GraalOptions.HotSpotPrintInlining) { + final int mod = method.getModifiers(); + // 1234567 + TTY.print(" "); // print timestamp + // 1234 + TTY.print(" "); // print compilation number + // % s ! b n + TTY.print("%c%c%c%c%c ", + ' ', + Modifier.isSynchronized(mod) ? 's' : ' ', + ' ', + ' ', + Modifier.isNative(mod) ? 'n' : ' '); + TTY.print(" "); // more indent + TTY.print(" "); // initial inlining indent + final int level = computeInliningLevel(invoke); + for (int i = 0; i < level; i++) { + TTY.print(" "); + } + TTY.println(String.format("@ %d %s %s%s", + invoke.bci(), methodName(method, null), + success ? "" : "not inlining ", + String.format(msg, args))); + } + } + + public static boolean logInlinedMethod(InlineInfo info, String msg, Object... args) { + logInliningDecision(info, true, msg, args); + return true; + } + public static boolean logNotInlinedMethod(InlineInfo info, String msg, Object... args) { logInliningDecision(info, false, msg, args); return false; } public static void logInliningDecision(InlineInfo info, boolean success, String msg, final Object... args) { + printInlining(info, success, msg, args); if (shouldLogInliningDecision()) { logInliningDecision(methodName(info), success, msg, args); } }
*** 92,106 **** --- 135,144 ---- Debug.log(msg, args); } }); } public static boolean logInlinedMethod(InlineInfo info, String string, Object... args) { logInliningDecision(info, true, string, args); return true; } private static boolean logNotInlinedMethodAndReturnFalse(Invoke invoke, String msg) { if (shouldLogInliningDecision()) { String methodString = invoke.toString() + (invoke.callTarget() == null ? " callTarget=null" : invoke.callTarget().targetName()); logInliningDecision(methodString, false, msg, new Object[0]); }
*** 110,127 **** --- 148,167 ---- private static InlineInfo logNotInlinedMethodAndReturnNull(Invoke invoke, ResolvedJavaMethod method, String msg) { return logNotInlinedMethodAndReturnNull(invoke, method, msg, new Object[0]); } private static InlineInfo logNotInlinedMethodAndReturnNull(Invoke invoke, ResolvedJavaMethod method, String msg, Object... args) { + printInlining(method, invoke, false, msg, args); if (shouldLogInliningDecision()) { String methodString = methodName(method, invoke); logInliningDecision(methodString, false, msg, args); } return null; } private static boolean logNotInlinedMethodAndReturnFalse(Invoke invoke, ResolvedJavaMethod method, String msg) { + printInlining(method, invoke, false, msg, new Object[0]); if (shouldLogInliningDecision()) { String methodString = methodName(method, invoke); logInliningDecision(methodString, false, msg, new Object[0]); } return false;

graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File