# HG changeset patch # User Gilles Duboscq # Date 1394993993 -3600 # Node ID 36d39c597c799bde4cd442bcda55fb9de90cbecc # Parent e1a2302a42bcd9ec4860d146d9d0c3ba7c2163f1 Respect CIPrintCompilerName and output a timestamp in Graal's PrintCompilation implementation diff -r e1a2302a42bc -r 36d39c597c79 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Fri Mar 14 18:11:18 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Sun Mar 16 19:19:53 2014 +0100 @@ -54,6 +54,8 @@ public class CompilationTask implements Runnable, Comparable { + private static final long TIMESTAMP_START = System.currentTimeMillis(); + // Keep static finals in a group with withinEnqueue as the last one. CompilationTask can be // called from within it's own clinit so it needs to be careful about accessing state. Once // withinEnqueue is non-null we assume that CompilationTask is fully initialized. @@ -330,8 +332,12 @@ private void printCompilation() { final boolean isOSR = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI; final int mod = method.getModifiers(); - TTY.println(String.format("%7d %4d %c%c%c%c%c %s %s(%d bytes)", 0, id, isOSR ? '%' : ' ', Modifier.isSynchronized(mod) ? 's' : ' ', ' ', ' ', Modifier.isNative(mod) ? 'n' : ' ', - MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize())); + String compilerName = ""; + if (HotSpotCIPrintCompilerName.getValue()) { + compilerName = "Graal:"; + } + TTY.println(String.format("%s%7d %4d %c%c%c%c%c %s %s(%d bytes)", compilerName, (System.currentTimeMillis() - TIMESTAMP_START), id, isOSR ? '%' : ' ', Modifier.isSynchronized(mod) ? 's' + : ' ', ' ', ' ', Modifier.isNative(mod) ? 'n' : ' ', MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize())); } private HotSpotInstalledCode installMethod(final CompilationResult compResult) { diff -r e1a2302a42bc -r 36d39c597c79 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Mar 14 18:11:18 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Sun Mar 16 19:19:53 2014 +0100 @@ -235,6 +235,9 @@ if (HotSpotPrintInlining.getValue() == false) { HotSpotPrintInlining.setValue(config.printInlining); } + if (HotSpotCIPrintCompilerName.getValue() == false) { + HotSpotCIPrintCompilerName.setValue(config.printCompilerName); + } if (Boolean.valueOf(System.getProperty("graal.printconfig"))) { printConfig(config); diff -r e1a2302a42bc -r 36d39c597c79 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Fri Mar 14 18:11:18 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Sun Mar 16 19:19:53 2014 +0100 @@ -709,6 +709,7 @@ @HotSpotVMFlag(name = "DontCompileHugeMethods") @Stable public boolean dontCompileHugeMethods; @HotSpotVMFlag(name = "HugeMethodLimit") @Stable public int hugeMethodLimit; @HotSpotVMFlag(name = "PrintCompilation") @Stable public boolean printCompilation; + @HotSpotVMFlag(name = "CIPrintCompilerName") @Stable public boolean printCompilerName; @HotSpotVMFlag(name = "PrintInlining") @Stable public boolean printInlining; @HotSpotVMFlag(name = "GraalUseFastLocking") @Stable public boolean useFastLocking; @HotSpotVMFlag(name = "ForceUnreachable") @Stable public boolean forceUnreachable; diff -r e1a2302a42bc -r 36d39c597c79 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Fri Mar 14 18:11:18 2014 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java Sun Mar 16 19:19:53 2014 +0100 @@ -177,6 +177,8 @@ @Option(help = "") public static final OptionValue HotSpotPrintCompilation = new OptionValue<>(false); @Option(help = "") + public static final OptionValue HotSpotCIPrintCompilerName = new OptionValue<>(false); + @Option(help = "") public static final OptionValue HotSpotPrintInlining = new OptionValue<>(false); // Register allocator debugging