changeset 7569:7cae58134ff7

collection of Graal compilation speed metrics is now triggered by -XX:+CITime instead of -Dgraal.benchmark.compilation=true
author Doug Simon <doug.simon@oracle.com>
date Wed, 30 Jan 2013 22:33:04 +0100
parents 140d4d4ab3b9
children 2025455e7d80
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java mx/sanitycheck.py src/share/vm/graal/graalCompilerToVM.cpp
diffstat 4 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Wed Jan 30 21:36:28 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Wed Jan 30 22:33:04 2013 +0100
@@ -36,6 +36,7 @@
     public boolean windowsOs;
     public int codeEntryAlignment;
     public boolean verifyOops;
+    public boolean ciTime;
     public boolean useFastLocking;
     public boolean useTLAB;
     public boolean useBiasedLocking;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Wed Jan 30 21:36:28 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Wed Jan 30 22:33:04 2013 +0100
@@ -56,8 +56,6 @@
 
     private final HotSpotGraalRuntime graalRuntime;
 
-    private static final boolean BenchmarkCompilation = Boolean.getBoolean("graal.benchmark.compilation");
-
     public final HotSpotResolvedPrimitiveType typeBoolean;
     public final HotSpotResolvedPrimitiveType typeChar;
     public final HotSpotResolvedPrimitiveType typeFloat;
@@ -76,6 +74,8 @@
 
     private PrintStream log = System.out;
 
+    private boolean quietMeterAndTime;
+
     public VMToCompilerImpl(HotSpotGraalRuntime compiler) {
         this.graalRuntime = compiler;
 
@@ -98,7 +98,8 @@
 
     public void startCompiler() throws Throwable {
 
-        long offset = HotSpotGraalRuntime.getInstance().getConfig().graalMirrorInClassOffset;
+        HotSpotVMConfig config = graalRuntime.getConfig();
+        long offset = config.graalMirrorInClassOffset;
         initMirror(typeBoolean, offset);
         initMirror(typeChar, offset);
         initMirror(typeFloat, offset);
@@ -126,11 +127,11 @@
             }
         }
 
-        if (BenchmarkCompilation) {
+        if (config.ciTime) {
+            quietMeterAndTime = (GraalOptions.Meter == null && GraalOptions.Time == null);
             GraalOptions.Debug = true;
             GraalOptions.Meter = "";
             GraalOptions.Time = "";
-            GraalOptions.SummarizeDebugValues = true;
         }
 
         if (GraalOptions.Debug) {
@@ -203,7 +204,7 @@
      */
     protected void phaseTransition(String phase) {
         CompilationStatistics.clear(phase);
-        if (BenchmarkCompilation) {
+        if (graalRuntime.getConfig().ciTime) {
             parsedBytecodesPerSecond = MetricRateInPhase.snapshot(phase, parsedBytecodesPerSecond, BytecodesParsed, CompilationTime, TimeUnit.SECONDS);
             inlinedBytecodesPerSecond = MetricRateInPhase.snapshot(phase, inlinedBytecodesPerSecond, InlinedBytecodes, CompilationTime, TimeUnit.SECONDS);
         }
@@ -310,7 +311,7 @@
             CompilationTask.withinEnqueue.set(Boolean.FALSE);
         }
 
-        if (Debug.isEnabled()) {
+        if (Debug.isEnabled() && !quietMeterAndTime) {
             List<DebugValueMap> topLevelMaps = DebugValueMap.getTopLevelMaps();
             List<DebugValue> debugValues = KeyRegistry.getDebugValues();
             if (debugValues.size() > 0) {
@@ -345,7 +346,7 @@
         }
         phaseTransition("final");
 
-        if (BenchmarkCompilation) {
+        if (graalRuntime.getConfig().ciTime) {
             parsedBytecodesPerSecond.printAll("ParsedBytecodesPerSecond");
             inlinedBytecodesPerSecond.printAll("InlinedBytecodesPerSecond");
         }
--- a/mx/sanitycheck.py	Wed Jan 30 21:36:28 2013 +0100
+++ b/mx/sanitycheck.py	Wed Jan 30 22:33:04 2013 +0100
@@ -290,7 +290,7 @@
             parser.addMatcher(scoreMatcher)
 
         if self.benchmarkCompilationRate:
-            opts.append('-Dgraal.benchmark.compilation=true')
+            opts.append('-XX:+CITime')
             bps = re.compile(r"ParsedBytecodesPerSecond@final: (?P<rate>[0-9]+)")
             ibps = re.compile(r"InlinedBytecodesPerSecond@final: (?P<rate>[0-9]+)")
             parser.addMatcher(ValuesMatcher(bps, {'group' : 'ParsedBytecodesPerSecond', 'name' : self.name, 'score' : '<rate>'}))
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Wed Jan 30 21:36:28 2013 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Wed Jan 30 22:33:04 2013 +0100
@@ -607,6 +607,7 @@
   set_boolean("windowsOs", false);
 #endif
   set_boolean("verifyOops", VerifyOops);
+  set_boolean("ciTime", CITime);
   set_boolean("useFastLocking", GraalUseFastLocking);
   set_boolean("useBiasedLocking", UseBiasedLocking);
   set_boolean("usePopCountInstruction", UsePopCountInstruction);