changeset 12780:430a95455271

removed deprecated mechanism for implementing -XX:+CITime in Graal
author Doug Simon <doug.simon@oracle.com>
date Tue, 19 Nov 2013 01:38:22 +0100
parents f6c511451e4a
children 6ae55c10796f
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/MetricRateInPhase.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java
diffstat 2 files changed, 0 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/MetricRateInPhase.java	Tue Nov 19 01:31:19 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.hotspot.bridge;
-
-import java.io.*;
-import java.util.concurrent.*;
-
-import com.oracle.graal.debug.*;
-import com.oracle.graal.debug.internal.*;
-
-/**
- * The rate of accumulation for a metric within an execution phase.
- */
-final class MetricRateInPhase {
-
-    private final String phase;
-    private final MetricRateInPhase previous;
-    private final long time;
-    private final long value;
-    private final TimeUnit timeUnit;
-
-    public static MetricRateInPhase snapshot(String phase, MetricRateInPhase previous, DebugMetric metric, DebugTimer timer, TimeUnit timeUnit) {
-        return new MetricRateInPhase(phase, previous, metric, timer, timeUnit);
-    }
-
-    private MetricRateInPhase(String phase, MetricRateInPhase previous, DebugMetric metric, DebugTimer timer, TimeUnit timeUnit) {
-        this.phase = phase;
-        this.previous = previous;
-        this.time = VMToCompilerImpl.collectTotal((DebugValue) timer);
-        this.value = VMToCompilerImpl.collectTotal((DebugValue) metric);
-        this.timeUnit = timeUnit;
-    }
-
-    public int rate() {
-        long t = time;
-        long v = value;
-        if (previous != null) {
-            t -= previous.time;
-            v -= previous.value;
-        }
-
-        t = timeUnit.convert(t, TimeUnit.NANOSECONDS);
-        if (t == 0) {
-            t = 1;
-        }
-        return (int) (v / t);
-    }
-
-    public void printAll(String label, PrintStream stream) {
-        MetricRateInPhase rs = this;
-        while (rs != null) {
-            stream.println(label + "@" + rs.phase + ": " + rs.rate());
-            rs = rs.previous;
-        }
-    }
-}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Tue Nov 19 01:31:19 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Tue Nov 19 01:38:22 2013 +0100
@@ -25,10 +25,7 @@
 
 import static com.oracle.graal.compiler.GraalDebugConfig.*;
 import static com.oracle.graal.graph.UnsafeAccess.*;
-import static com.oracle.graal.hotspot.CompilationTask.*;
 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
-import static com.oracle.graal.java.GraphBuilderPhase.*;
-import static com.oracle.graal.phases.common.InliningUtil.*;
 import static java.util.concurrent.TimeUnit.*;
 
 import java.io.*;
@@ -255,10 +252,6 @@
      */
     protected void phaseTransition(String phase) {
         CompilationStatistics.clear(phase);
-        if (runtime.getConfig().ciTime) {
-            parsedBytecodesPerSecond = MetricRateInPhase.snapshot(phase, parsedBytecodesPerSecond, BytecodesParsed, CompilationTime, TimeUnit.SECONDS);
-            inlinedBytecodesPerSecond = MetricRateInPhase.snapshot(phase, inlinedBytecodesPerSecond, InlinedBytecodes, CompilationTime, TimeUnit.SECONDS);
-        }
     }
 
     /**
@@ -343,9 +336,6 @@
         System.exit(0);
     }
 
-    private MetricRateInPhase parsedBytecodesPerSecond;
-    private MetricRateInPhase inlinedBytecodesPerSecond;
-
     private void enqueue(Method m) throws Throwable {
         JavaMethod javaMethod = runtime.getHostProviders().getMetaAccess().lookupJavaMethod(m);
         assert !Modifier.isAbstract(((HotSpotResolvedJavaMethod) javaMethod).getModifiers()) && !Modifier.isNative(((HotSpotResolvedJavaMethod) javaMethod).getModifiers()) : javaMethod;
@@ -374,11 +364,6 @@
         printDebugValues(ResetDebugValuesAfterBootstrap.getValue() ? "application" : null, false);
         phaseTransition("final");
 
-        if (runtime.getConfig().ciTime) {
-            parsedBytecodesPerSecond.printAll("ParsedBytecodesPerSecond", System.out);
-            inlinedBytecodesPerSecond.printAll("InlinedBytecodesPerSecond", System.out);
-        }
-
         SnippetCounter.printGroups(TTY.out().out());
         BenchmarkCounters.shutdown(runtime.getCompilerToVM(), compilerStartTime);
     }