diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 15045:0286888f792b

fix PrintCompilation formatting and use same time source
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 09 Apr 2014 16:33:32 -0700
parents 288c23143d47
children dbb1fe8348e6
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Wed Apr 09 18:31:45 2014 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Wed Apr 09 16:33:32 2014 -0700
@@ -59,8 +59,6 @@
 
 public class CompilationTask implements Runnable, Comparable<Object> {
 
-    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.
@@ -372,18 +370,18 @@
         }
         HotSpotVMConfig config = backend.getRuntime().getConfig();
         int compLevel = config.compilationLevelFullOptimization;
-        char compLevelChar;
+        String compLevelString;
         if (config.tieredCompilation) {
-            compLevelChar = '-';
+            compLevelString = "- ";
             if (compLevel != -1) {
-                compLevelChar = (char) ('0' + compLevel);
+                compLevelString = (char) ('0' + compLevel) + " ";
             }
         } else {
-            compLevelChar = ' ';
+            compLevelString = "";
         }
         boolean hasExceptionHandlers = method.getExceptionHandlers().length > 0;
-        TTY.println(String.format("%s%7d %4d %c%c%c%c%c%c      %s %s(%d bytes)", compilerName, (System.currentTimeMillis() - TIMESTAMP_START), id, isOSR ? '%' : ' ',
-                        Modifier.isSynchronized(mod) ? 's' : ' ', hasExceptionHandlers ? '!' : ' ', blocking ? 'b' : ' ', Modifier.isNative(mod) ? 'n' : ' ', compLevelChar,
+        TTY.println(String.format("%s%7d %4d %c%c%c%c%c %s      %s %s(%d bytes)", compilerName, backend.getRuntime().compilerToVm.getTimeStamp(), id, isOSR ? '%' : ' ',
+                        Modifier.isSynchronized(mod) ? 's' : ' ', hasExceptionHandlers ? '!' : ' ', blocking ? 'b' : ' ', Modifier.isNative(mod) ? 'n' : ' ', compLevelString,
                         MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize()));
     }