changeset 22394:528eeeca785e

Merge.
author Roland Schatz <roland.schatz@oracle.com>
date Wed, 29 Jul 2015 10:36:54 +0200
parents 8217ef77a80a (current diff) bdfd42480dc9 (diff)
children 63e7eb179710
files jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/LogStream.java jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/Management.java jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/TTY.java jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/TTYStreamProvider.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIVMEventListener.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotTTYStreamProvider.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/CountingProxy.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/Logger.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/LoggingProxy.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/ProxyUtil.java make/defs.make make/jvmci.make mx.jvmci/suite.py
diffstat 17 files changed, 13 insertions(+), 1548 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/LogStream.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,477 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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 jdk.internal.jvmci.debug;
-
-import java.io.*;
-
-/**
- * A utility for printing compiler debug and informational output to an output stream.
- *
- * A {@link LogStream} instance maintains an internal buffer that is flushed to the underlying
- * output stream every time one of the {@code println} methods is invoked, or a newline character (
- * {@code '\n'}) is written.
- *
- * All of the {@code print} and {@code println} methods return the {code LogStream} instance on
- * which they were invoked. This allows chaining of these calls to mitigate use of String
- * concatenation by the caller.
- *
- * A {@code LogStream} maintains a current {@linkplain #indentationLevel() indentation} level. Each
- * line of output written to this stream has {@code n} spaces prefixed to it where {@code n} is the
- * value that would be returned by {@link #indentationLevel()} when the first character of a new
- * line is written.
- *
- * A {@code LogStream} maintains a current {@linkplain #position() position} for the current line
- * being written. This position can be advanced to a specified position by
- * {@linkplain #fillTo(int, char) filling} this stream with a given character.
- */
-public class LogStream {
-
-    /**
-     * Null output stream that simply swallows any output sent to it.
-     */
-    public static final LogStream SINK = new LogStream();
-
-    private static final PrintStream SINK_PS = new PrintStream(new OutputStream() {
-
-        @Override
-        public void write(int b) throws IOException {
-        }
-    });
-
-    private LogStream() {
-        this.ps = null;
-        this.lineBuffer = null;
-    }
-
-    /**
-     * The output stream to which this log stream writes.
-     */
-    private final PrintStream ps;
-
-    private final StringBuilder lineBuffer;
-    private int indentationLevel;
-    private char indentation = ' ';
-    private boolean indentationDisabled;
-
-    public final PrintStream out() {
-        if (ps == null) {
-            return SINK_PS;
-        }
-        return ps;
-    }
-
-    /**
-     * The system dependent line separator.
-     */
-    public static final String LINE_SEPARATOR = System.getProperty("line.separator");
-
-    /**
-     * Creates a new log stream.
-     *
-     * @param os the underlying output stream to which prints are sent
-     */
-    public LogStream(OutputStream os) {
-        ps = os instanceof PrintStream ? (PrintStream) os : new PrintStream(os);
-        lineBuffer = new StringBuilder(100);
-    }
-
-    /**
-     * Creates a new log stream that shares the same {@linkplain #ps output stream} as a given
-     * {@link LogStream}.
-     *
-     * @param log a LogStream whose output stream is shared with this one
-     */
-    public LogStream(LogStream log) {
-        ps = log.ps;
-        lineBuffer = new StringBuilder(100);
-    }
-
-    /**
-     * Prepends {@link #indentation} to the current output line until its write position is equal to
-     * the current {@linkplain #indentationLevel()} level.
-     */
-    private void indent() {
-        if (ps != null) {
-            if (!indentationDisabled && indentationLevel != 0) {
-                while (lineBuffer.length() < indentationLevel) {
-                    lineBuffer.append(indentation);
-                }
-            }
-        }
-    }
-
-    private LogStream flushLine(boolean withNewline) {
-        if (ps != null) {
-            if (withNewline) {
-                lineBuffer.append(LINE_SEPARATOR);
-            }
-            ps.print(lineBuffer.toString());
-            ps.flush();
-            lineBuffer.setLength(0);
-        }
-        return this;
-    }
-
-    /**
-     * Flushes the stream. This is done by terminating the current line if it is not at position 0
-     * and then flushing the underlying output stream.
-     */
-    public void flush() {
-        if (ps != null) {
-            if (lineBuffer.length() != 0) {
-                flushLine(false);
-            }
-            ps.flush();
-        }
-    }
-
-    /**
-     * Gets the current column position of this log stream.
-     *
-     * @return the current column position of this log stream
-     */
-    public int position() {
-        return lineBuffer == null ? 0 : lineBuffer.length();
-
-    }
-
-    /**
-     * Gets the current indentation level for this log stream.
-     *
-     * @return the current indentation level for this log stream.
-     */
-    public int indentationLevel() {
-        return indentationLevel;
-    }
-
-    /**
-     * Adjusts the current indentation level of this log stream.
-     *
-     * @param delta
-     */
-    public void adjustIndentation(int delta) {
-        if (delta < 0) {
-            indentationLevel = Math.max(0, indentationLevel + delta);
-        } else {
-            indentationLevel += delta;
-        }
-    }
-
-    /**
-     * Gets the current indentation character of this log stream.
-     */
-    public char indentation() {
-        return indentation;
-    }
-
-    public void disableIndentation() {
-        indentationDisabled = true;
-    }
-
-    public void enableIndentation() {
-        indentationDisabled = false;
-    }
-
-    /**
-     * Sets the character used for indentation.
-     */
-    public void setIndentation(char c) {
-        indentation = c;
-    }
-
-    /**
-     * Advances this stream's {@linkplain #position() position} to a given position by repeatedly
-     * appending a given character as necessary.
-     *
-     * @param position the position to which this stream's position will be advanced
-     * @param filler the character used to pad the stream
-     */
-    public LogStream fillTo(int position, char filler) {
-        if (ps != null) {
-            indent();
-            while (lineBuffer.length() < position) {
-                lineBuffer.append(filler);
-            }
-        }
-        return this;
-    }
-
-    /**
-     * Writes a boolean value to this stream as {@code "true"} or {@code "false"}.
-     *
-     * @param b the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(boolean b) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(b);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a boolean value to this stream followed by a {@linkplain #LINE_SEPARATOR line
-     * separator}.
-     *
-     * @param b the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(boolean b) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(b);
-            return flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a character value to this stream.
-     *
-     * @param c the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(char c) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(c);
-            if (c == '\n') {
-                if (lineBuffer.indexOf(LINE_SEPARATOR, lineBuffer.length() - LINE_SEPARATOR.length()) != -1) {
-                    flushLine(false);
-                }
-            }
-        }
-        return this;
-    }
-
-    /**
-     * Writes a character value to this stream followed by a {@linkplain #LINE_SEPARATOR line
-     * separator}.
-     *
-     * @param c the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(char c) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(c);
-            flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Prints an int value.
-     *
-     * @param i the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(int i) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(i);
-        }
-        return this;
-    }
-
-    /**
-     * Writes an int value to this stream followed by a {@linkplain #LINE_SEPARATOR line separator}.
-     *
-     * @param i the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(int i) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(i);
-            return flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a float value to this stream.
-     *
-     * @param f the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(float f) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(f);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a float value to this stream followed by a {@linkplain #LINE_SEPARATOR line separator}
-     * .
-     *
-     * @param f the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(float f) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(f);
-            return flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a long value to this stream.
-     *
-     * @param l the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(long l) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(l);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a long value to this stream followed by a {@linkplain #LINE_SEPARATOR line separator}.
-     *
-     * @param l the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(long l) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(l);
-            return flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a double value to this stream.
-     *
-     * @param d the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(double d) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(d);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a double value to this stream followed by a {@linkplain #LINE_SEPARATOR line
-     * separator}.
-     *
-     * @param d the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(double d) {
-        if (ps != null) {
-            indent();
-            lineBuffer.append(d);
-            return flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a {@code String} value to this stream. This method ensures that the
-     * {@linkplain #position() position} of this stream is updated correctly with respect to any
-     * {@linkplain #LINE_SEPARATOR line separators} present in {@code s}.
-     *
-     * @param s the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream print(String s) {
-        if (ps != null) {
-            if (s == null) {
-                indent();
-                lineBuffer.append(s);
-                return this;
-            }
-
-            int index = 0;
-            int next = s.indexOf(LINE_SEPARATOR, index);
-            while (index < s.length()) {
-                indent();
-                if (next > index) {
-                    lineBuffer.append(s.substring(index, next));
-                    flushLine(true);
-                    index = next + LINE_SEPARATOR.length();
-                    next = s.indexOf(LINE_SEPARATOR, index);
-                } else {
-                    lineBuffer.append(s.substring(index));
-                    break;
-                }
-            }
-        }
-        return this;
-    }
-
-    /**
-     * Writes a {@code String} value to this stream followed by a {@linkplain #LINE_SEPARATOR line
-     * separator}.
-     *
-     * @param s the value to be printed
-     * @return this {@link LogStream} instance
-     */
-    public LogStream println(String s) {
-        if (ps != null) {
-            print(s);
-            flushLine(true);
-        }
-        return this;
-    }
-
-    /**
-     * Writes a formatted string to this stream.
-     *
-     * @param format a format string as described in {@link String#format(String, Object...)}
-     * @param args the arguments to be formatted
-     * @return this {@link LogStream} instance
-     */
-    public LogStream printf(String format, Object... args) {
-        if (ps != null) {
-            print(String.format(format, args));
-        }
-        return this;
-    }
-
-    /**
-     * Writes a {@linkplain #LINE_SEPARATOR line separator} to this stream.
-     *
-     * @return this {@code LogStream} instance
-     */
-    public LogStream println() {
-        if (ps != null) {
-            indent();
-            flushLine(true);
-        }
-        return this;
-    }
-}
--- a/jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/Management.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2015, 2015, 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 jdk.internal.jvmci.debug;
-
-import static java.lang.Thread.*;
-
-import java.lang.management.*;
-
-import javax.management.*;
-
-public class Management {
-
-    private static final com.sun.management.ThreadMXBean threadMXBean = Management.initThreadMXBean();
-
-    /**
-     * The amount of memory allocated by
-     * {@link com.sun.management.ThreadMXBean#getThreadAllocatedBytes(long)} itself.
-     */
-    private static final long threadMXBeanOverhead = -getCurrentThreadAllocatedBytes() + getCurrentThreadAllocatedBytes();
-
-    public static long getCurrentThreadAllocatedBytes() {
-        return threadMXBean.getThreadAllocatedBytes(currentThread().getId()) - threadMXBeanOverhead;
-    }
-
-    private static com.sun.management.ThreadMXBean initThreadMXBean() {
-        try {
-            return (com.sun.management.ThreadMXBean) ManagementFactory.getThreadMXBean();
-        } catch (Error err) {
-            return new UnimplementedBean();
-        }
-    }
-
-    public static ThreadMXBean getThreadMXBean() {
-        return threadMXBean;
-    }
-
-    private static class UnimplementedBean implements ThreadMXBean, com.sun.management.ThreadMXBean {
-
-        public ObjectName getObjectName() {
-            return null;
-        }
-
-        public long getThreadAllocatedBytes(long arg0) {
-            return 0;
-        }
-
-        public long[] getThreadAllocatedBytes(long[] arg0) {
-            return null;
-        }
-
-        public long[] getThreadCpuTime(long[] arg0) {
-            return null;
-        }
-
-        public long[] getThreadUserTime(long[] arg0) {
-            return null;
-        }
-
-        public boolean isThreadAllocatedMemoryEnabled() {
-            return false;
-        }
-
-        public boolean isThreadAllocatedMemorySupported() {
-            return false;
-        }
-
-        public void setThreadAllocatedMemoryEnabled(boolean arg0) {
-        }
-
-        public int getThreadCount() {
-            return 0;
-        }
-
-        public int getPeakThreadCount() {
-            return 0;
-        }
-
-        public long getTotalStartedThreadCount() {
-            return 0;
-        }
-
-        public int getDaemonThreadCount() {
-            return 0;
-        }
-
-        public long[] getAllThreadIds() {
-            return null;
-        }
-
-        public ThreadInfo getThreadInfo(long id) {
-            return null;
-        }
-
-        public ThreadInfo[] getThreadInfo(long[] ids) {
-            return null;
-        }
-
-        public ThreadInfo getThreadInfo(long id, int maxDepth) {
-            return null;
-        }
-
-        public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth) {
-            return null;
-        }
-
-        public boolean isThreadContentionMonitoringSupported() {
-            return false;
-        }
-
-        public boolean isThreadContentionMonitoringEnabled() {
-            return false;
-        }
-
-        public void setThreadContentionMonitoringEnabled(boolean enable) {
-        }
-
-        public long getCurrentThreadCpuTime() {
-            return 0;
-        }
-
-        public long getCurrentThreadUserTime() {
-            return 0;
-        }
-
-        public long getThreadCpuTime(long id) {
-            return 0;
-        }
-
-        public long getThreadUserTime(long id) {
-            return 0;
-        }
-
-        public boolean isThreadCpuTimeSupported() {
-            return false;
-        }
-
-        public boolean isCurrentThreadCpuTimeSupported() {
-            return false;
-        }
-
-        public boolean isThreadCpuTimeEnabled() {
-            return false;
-        }
-
-        public void setThreadCpuTimeEnabled(boolean enable) {
-        }
-
-        public long[] findMonitorDeadlockedThreads() {
-            return null;
-        }
-
-        public void resetPeakThreadCount() {
-        }
-
-        public long[] findDeadlockedThreads() {
-            return null;
-        }
-
-        public boolean isObjectMonitorUsageSupported() {
-            return false;
-        }
-
-        public boolean isSynchronizerUsageSupported() {
-            return false;
-        }
-
-        public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers) {
-            return null;
-        }
-
-        public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers) {
-            return null;
-        }
-    }
-}
--- a/jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/TTY.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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 jdk.internal.jvmci.debug;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.regex.*;
-
-import jdk.internal.jvmci.service.*;
-
-/**
- * A collection of static methods for printing debug and informational output to a global
- * {@link LogStream}. The output can be (temporarily) suppressed per thread through use of a
- * {@linkplain Filter filter}.
- */
-public class TTY {
-
-    /**
-     * Support for thread-local suppression of {@link TTY}.
-     */
-    public static class Filter {
-
-        private LogStream previous;
-        private final Thread thread = Thread.currentThread();
-
-        /**
-         * Creates an object that will suppress {@link TTY} for the current thread if the given
-         * filter does not match the given object. To revert the suppression state to how it was
-         * before this call, the {@link #remove()} method must be called on the suppression object.
-         *
-         * @param filter the pattern for matching. If {@code null}, then the match is successful. If
-         *            it starts with "~", then a regular expression
-         *            {@linkplain Pattern#matches(String, CharSequence) match} is performed where
-         *            the regular expression is specified by {@code filter} without the "~" prefix.
-         *            Otherwise, a simple {@linkplain String#contains(CharSequence) substring} match
-         *            is performed where {@code filter} is the substring used.
-         * @param object an object whose {@linkplain Object#toString() string} value is matched
-         *            against {@code filter}
-         */
-        public Filter(String filter, Object object) {
-            boolean suppressed = false;
-            if (filter != null) {
-                String input = object.toString();
-                if (filter.startsWith("~")) {
-                    suppressed = !Pattern.matches(filter.substring(1), input);
-                } else {
-                    suppressed = !input.contains(filter);
-                }
-                if (suppressed) {
-                    previous = out();
-                    log.set(LogStream.SINK);
-                }
-            }
-        }
-
-        /**
-         * Creates an object that will suppress {@link TTY} for the current thread. To revert the
-         * suppression state to how it was before this call, the {@link #remove()} method must be
-         * called on this filter object.
-         */
-        public Filter() {
-            previous = out();
-            log.set(LogStream.SINK);
-        }
-
-        /**
-         * Reverts the suppression state of {@link TTY} to how it was before this object was
-         * constructed.
-         */
-        public void remove() {
-            assert thread == Thread.currentThread();
-            if (previous != null) {
-                log.set(previous);
-            }
-        }
-    }
-
-    /**
-     * The {@link PrintStream} to which all non-suppressed output from {@link TTY} is written.
-     */
-    public static final PrintStream out;
-    static {
-        TTYStreamProvider p = Services.loadSingle(TTYStreamProvider.class, false);
-        out = p == null ? System.out : p.getStream();
-    }
-
-    private static final ThreadLocal<LogStream> log = new ThreadLocal<LogStream>() {
-
-        @Override
-        protected LogStream initialValue() {
-            return new LogStream(out);
-        }
-    };
-
-    public static boolean isSuppressed() {
-        return log.get() == LogStream.SINK;
-    }
-
-    /**
-     * Gets the thread-local log stream to which the static methods of this class send their output.
-     * This will either be a global log stream or the global {@linkplain LogStream#SINK sink}
-     * depending on whether any suppression {@linkplain Filter filters} are in effect for the
-     * current thread.
-     */
-    public static LogStream out() {
-        return log.get();
-    }
-
-    /**
-     * @see LogStream#print(String)
-     */
-    public static void print(String s) {
-        out().print(s);
-    }
-
-    /**
-     * @see LogStream#print(int)
-     */
-    public static void print(int i) {
-        out().print(i);
-    }
-
-    /**
-     * @see LogStream#print(long)
-     */
-    public static void print(long i) {
-        out().print(i);
-    }
-
-    /**
-     * @see LogStream#print(char)
-     */
-    public static void print(char c) {
-        out().print(c);
-    }
-
-    /**
-     * @see LogStream#print(boolean)
-     */
-    public static void print(boolean b) {
-        out().print(b);
-    }
-
-    /**
-     * @see LogStream#print(double)
-     */
-    public static void print(double d) {
-        out().print(d);
-    }
-
-    /**
-     * @see LogStream#print(float)
-     */
-    public static void print(float f) {
-        out().print(f);
-    }
-
-    /**
-     * @see LogStream#println(String)
-     */
-    public static void println(String s) {
-        out().println(s);
-    }
-
-    /**
-     * @see LogStream#println()
-     */
-    public static void println() {
-        out().println();
-    }
-
-    /**
-     * @see LogStream#println(int)
-     */
-    public static void println(int i) {
-        out().println(i);
-    }
-
-    /**
-     * @see LogStream#println(long)
-     */
-    public static void println(long l) {
-        out().println(l);
-    }
-
-    /**
-     * @see LogStream#println(char)
-     */
-    public static void println(char c) {
-        out().println(c);
-    }
-
-    /**
-     * @see LogStream#println(boolean)
-     */
-    public static void println(boolean b) {
-        out().println(b);
-    }
-
-    /**
-     * @see LogStream#println(double)
-     */
-    public static void println(double d) {
-        out().println(d);
-    }
-
-    /**
-     * @see LogStream#println(float)
-     */
-    public static void println(float f) {
-        out().println(f);
-    }
-
-    public static void print(String format, Object... args) {
-        out().printf(format, args);
-    }
-
-    public static void println(String format, Object... args) {
-        out().printf(format + "%n", args);
-    }
-
-    public static void fillTo(int i) {
-        out().fillTo(i, ' ');
-    }
-
-    public static void printFields(Class<?> javaClass) {
-        final String className = javaClass.getSimpleName();
-        TTY.println(className + " {");
-        for (final Field field : javaClass.getFields()) {
-            printField(field, false);
-        }
-        TTY.println("}");
-    }
-
-    public static void printField(final Field field, boolean tabbed) {
-        final String fieldName = String.format("%35s", field.getName());
-        try {
-            String prefix = tabbed ? "" : "    " + fieldName + " = ";
-            String postfix = tabbed ? "\t" : "\n";
-            if (field.getType() == int.class) {
-                TTY.print(prefix + field.getInt(null) + postfix);
-            } else if (field.getType() == boolean.class) {
-                TTY.print(prefix + field.getBoolean(null) + postfix);
-            } else if (field.getType() == float.class) {
-                TTY.print(prefix + field.getFloat(null) + postfix);
-            } else if (field.getType() == String.class) {
-                TTY.print(prefix + field.get(null) + postfix);
-            } else if (field.getType() == Map.class) {
-                Map<?, ?> m = (Map<?, ?>) field.get(null);
-                TTY.print(prefix + printMap(m) + postfix);
-            } else {
-                TTY.print(prefix + field.get(null) + postfix);
-            }
-        } catch (IllegalAccessException e) {
-            // do nothing.
-        }
-    }
-
-    private static String printMap(Map<?, ?> m) {
-        StringBuilder sb = new StringBuilder();
-
-        List<String> keys = new ArrayList<>();
-        for (Object key : m.keySet()) {
-            keys.add((String) key);
-        }
-        Collections.sort(keys);
-
-        for (String key : keys) {
-            sb.append(key);
-            sb.append("\t");
-            sb.append(m.get(key));
-            sb.append("\n");
-        }
-
-        return sb.toString();
-    }
-
-    public static void flush() {
-        out().flush();
-    }
-}
--- a/jvmci/jdk.internal.jvmci.debug/src/jdk/internal/jvmci/debug/TTYStreamProvider.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2015, 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 jdk.internal.jvmci.debug;
-
-import java.io.*;
-
-/**
- * Provides a {@link PrintStream} that writes to the underlying log stream of the VM.
- */
-public interface TTYStreamProvider {
-    PrintStream getStream();
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java	Tue Jul 28 08:46:37 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java	Wed Jul 29 10:36:54 2015 +0200
@@ -25,12 +25,10 @@
 import static jdk.internal.jvmci.common.UnsafeAccess.*;
 import static jdk.internal.jvmci.hotspot.InitTimer.*;
 
-import java.lang.reflect.*;
 import java.util.*;
 
 import jdk.internal.jvmci.code.*;
 import jdk.internal.jvmci.common.*;
-import jdk.internal.jvmci.hotspot.logging.*;
 import jdk.internal.jvmci.meta.*;
 import jdk.internal.jvmci.options.*;
 import jdk.internal.jvmci.runtime.*;
@@ -76,11 +74,8 @@
         // to retrieve configuration details.
         CompilerToVM toVM = this.compilerToVm;
 
-        if (CountingProxy.ENABLED) {
-            toVM = CountingProxy.getProxy(CompilerToVM.class, toVM);
-        }
-        if (Logger.ENABLED) {
-            toVM = LoggingProxy.getProxy(CompilerToVM.class, toVM);
+        for (HotSpotVMEventListener vmEventListener : vmEventListeners) {
+            toVM = vmEventListener.completeInitialization(this, toVM);
         }
 
         this.compilerToVm = toVM;
@@ -204,10 +199,6 @@
             config = new HotSpotVMConfig(compilerToVm);
         }
 
-        if (Boolean.valueOf(System.getProperty("jvmci.printconfig"))) {
-            printConfig(config);
-        }
-
         String hostArchitecture = config.getHostArchitectureName();
 
         HotSpotJVMCIBackendFactory factory;
@@ -237,21 +228,6 @@
         return jvmciMirrors.get(javaClass);
     }
 
-    private static void printConfig(HotSpotVMConfig config) {
-        Field[] fields = config.getClass().getDeclaredFields();
-        Map<String, Field> sortedFields = new TreeMap<>();
-        for (Field f : fields) {
-            f.setAccessible(true);
-            sortedFields.put(f.getName(), f);
-        }
-        for (Field f : sortedFields.values()) {
-            try {
-                Logger.info(String.format("%9s %-40s = %s", f.getType().getSimpleName(), f.getName(), Logger.pretty(f.get(config))));
-            } catch (Exception e) {
-            }
-        }
-    }
-
     public HotSpotVMConfig getConfig() {
         return config;
     }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIVMEventListener.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2015, 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 jdk.internal.jvmci.hotspot;
-
-import jdk.internal.jvmci.service.*;
-
-@ServiceProvider(HotSpotVMEventListener.class)
-public class HotSpotJVMCIVMEventListener implements HotSpotVMEventListener {
-
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java	Tue Jul 28 08:46:37 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java	Wed Jul 29 10:36:54 2015 +0200
@@ -31,7 +31,6 @@
 import java.util.*;
 
 import jdk.internal.jvmci.common.*;
-import jdk.internal.jvmci.debug.*;
 import jdk.internal.jvmci.meta.*;
 import jdk.internal.jvmci.options.*;
 
@@ -418,8 +417,8 @@
             if (metaspaceMethodData != 0) {
                 methodData = new HotSpotMethodData(metaspaceMethodData);
                 if (TraceMethodDataFilter != null && this.format("%H.%n").contains(TraceMethodDataFilter)) {
-                    TTY.println("Raw method data for " + this.format("%H.%n(%p)") + ":");
-                    TTY.println(methodData.toString());
+                    System.out.println("Raw method data for " + this.format("%H.%n(%p)") + ":");
+                    System.out.println(methodData.toString());
                 }
             }
         }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotTTYStreamProvider.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2015, 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 jdk.internal.jvmci.hotspot;
-
-import java.io.*;
-
-import jdk.internal.jvmci.debug.*;
-import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
-import jdk.internal.jvmci.service.*;
-
-@ServiceProvider(TTYStreamProvider.class)
-class HotSpotTTYStreamProvider implements TTYStreamProvider {
-
-    public PrintStream getStream() {
-        return Options.LogFile.getStream();
-    }
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java	Tue Jul 28 08:46:37 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java	Wed Jul 29 10:36:54 2015 +0200
@@ -60,4 +60,11 @@
      */
     default void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult) {
     }
+
+    /**
+     * @param hotSpotJVMCIRuntime
+     */
+    default CompilerToVM completeInitialization(HotSpotJVMCIRuntime hotSpotJVMCIRuntime, CompilerToVM compilerToVM) {
+        return compilerToVM;
+    }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/CountingProxy.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, 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 jdk.internal.jvmci.hotspot.logging;
-
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import jdk.internal.jvmci.debug.*;
-
-/**
- * A java.lang.reflect proxy that hierarchically logs all method invocations along with their
- * parameters and return values.
- */
-public class CountingProxy<T> implements InvocationHandler {
-
-    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("jvmci.countcalls"));
-
-    private T delegate;
-
-    private ConcurrentHashMap<Method, AtomicLong> calls = new ConcurrentHashMap<>();
-
-    public CountingProxy(T delegate) {
-        assert ENABLED;
-        TTY.println("Counting proxy for " + delegate.getClass().getSimpleName() + " created");
-        this.delegate = delegate;
-        proxies.add(this);
-    }
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        int argCount = args == null ? 0 : args.length;
-        if (method.getParameterTypes().length != argCount) {
-            throw new RuntimeException("wrong parameter count");
-        }
-        final Object result;
-        if (!calls.containsKey(method)) {
-            calls.putIfAbsent(method, new AtomicLong(0));
-        }
-        AtomicLong count = calls.get(method);
-        count.incrementAndGet();
-        try {
-            if (args == null) {
-                result = method.invoke(delegate);
-            } else {
-                result = method.invoke(delegate, args);
-            }
-        } catch (InvocationTargetException e) {
-            throw e.getCause();
-        }
-        return result;
-    }
-
-    public static <T> T getProxy(Class<T> interf, T delegate) {
-        Class<?>[] interfaces = ProxyUtil.getAllInterfaces(delegate.getClass());
-        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new CountingProxy<>(delegate));
-        return interf.cast(obj);
-    }
-
-    private static ArrayList<CountingProxy<?>> proxies = new ArrayList<>();
-
-    static {
-        if (ENABLED) {
-            Runtime.getRuntime().addShutdownHook(new Thread() {
-
-                @Override
-                public void run() {
-                    for (CountingProxy<?> proxy : proxies) {
-                        proxy.print();
-                    }
-                }
-            });
-        }
-    }
-
-    protected void print() {
-        long sum = 0;
-        for (Map.Entry<Method, AtomicLong> entry : calls.entrySet()) {
-            Method method = entry.getKey();
-            long count = entry.getValue().get();
-            sum += count;
-            TTY.println(delegate.getClass().getSimpleName() + "." + method.getName() + ": " + count);
-        }
-        TTY.println(delegate.getClass().getSimpleName() + " calls: " + sum);
-    }
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/Logger.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, 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 jdk.internal.jvmci.hotspot.logging;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import jdk.internal.jvmci.debug.*;
-import jdk.internal.jvmci.hotspot.*;
-
-/**
- * Scoped logging class used to display the call hierarchy of {@link CompilerToVM} calls.
- */
-public class Logger {
-
-    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("jvmci.debug"));
-    private static final int SPACING = 4;
-    private static final ThreadLocal<Logger> loggerTL;
-
-    private Deque<Boolean> openStack = new LinkedList<>();
-    private boolean open = false;
-    private int level = 0;
-
-    private static final PrintStream out;
-
-    static {
-        if (ENABLED) {
-            loggerTL = new ThreadLocal<Logger>() {
-
-                @Override
-                protected Logger initialValue() {
-                    return new Logger();
-                }
-            };
-        } else {
-            loggerTL = null;
-        }
-
-        PrintStream ps = null;
-        String filename = System.getProperty("jvmci.info_file");
-        if (filename != null && !"".equals(filename)) {
-            try {
-                ps = new PrintStream(new FileOutputStream(filename));
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-                ps = null;
-            }
-        }
-        out = ps;
-        if (out != null) {
-            out.println("start: " + new Date());
-        }
-    }
-
-    public static void info(String message) {
-        if (ENABLED) {
-            log(message);
-        } else {
-            TTY.println(message);
-        }
-        if (out != null) {
-            out.println(message);
-            out.flush();
-        }
-    }
-
-    public static void log(String message) {
-        if (ENABLED) {
-            Logger logger = loggerTL.get();
-            for (String line : message.split("\n")) {
-                if (logger.open) {
-                    TTY.println("...");
-                    logger.open = false;
-                }
-                TTY.print(space(logger.level));
-                TTY.println(line);
-            }
-        }
-    }
-
-    public static void startScope(String message) {
-        if (ENABLED) {
-            Logger logger = loggerTL.get();
-            if (logger.open) {
-                TTY.println("...");
-                logger.open = false;
-            }
-            TTY.print(space(logger.level));
-            TTY.print(message);
-            logger.openStack.push(logger.open);
-            logger.open = true;
-            logger.level++;
-        }
-    }
-
-    public static void endScope(String message) {
-        if (ENABLED) {
-            Logger logger = loggerTL.get();
-            logger.level--;
-            if (logger.open) {
-                TTY.println(message);
-            } else {
-                TTY.println(space(logger.level) + "..." + message);
-            }
-            logger.open = logger.openStack.pop();
-        }
-    }
-
-    private static String[] spaces = new String[50];
-
-    private static String space(int count) {
-        assert count >= 0;
-        String result;
-        if (count >= spaces.length || spaces[count] == null) {
-            StringBuilder str = new StringBuilder();
-            for (int i = 0; i < count * SPACING; i++) {
-                str.append(' ');
-            }
-            result = str.toString();
-            if (count < spaces.length) {
-                spaces[count] = result;
-            }
-        } else {
-            result = spaces[count];
-        }
-        return result;
-    }
-
-    public static String pretty(Object value) {
-        if (value == null) {
-            return "null";
-        }
-
-        Class<?> klass = value.getClass();
-        if (value instanceof Void) {
-            return "void";
-        } else if (value instanceof String) {
-            return "\"" + value + "\"";
-        } else if (value instanceof Method) {
-            return "method \"" + ((Method) value).getName() + "\"";
-        } else if (value instanceof Class<?>) {
-            return "class \"" + ((Class<?>) value).getSimpleName() + "\"";
-        } else if (value instanceof Integer) {
-            if ((Integer) value < 10) {
-                return value.toString();
-            }
-            return value + " (0x" + Integer.toHexString((Integer) value) + ")";
-        } else if (value instanceof Long) {
-            if ((Long) value < 10 && (Long) value > -10) {
-                return value + "l";
-            }
-            return value + "l (0x" + Long.toHexString((Long) value) + "l)";
-        } else if (klass.isArray()) {
-            StringBuilder str = new StringBuilder();
-            int dimensions = 0;
-            while (klass.isArray()) {
-                dimensions++;
-                klass = klass.getComponentType();
-            }
-            int length = Array.getLength(value);
-            str.append(klass.getSimpleName()).append('[').append(length).append(']');
-            for (int i = 1; i < dimensions; i++) {
-                str.append("[]");
-            }
-            str.append(" {");
-            for (int i = 0; i < length; i++) {
-                str.append(pretty(Array.get(value, i)));
-                if (i < length - 1) {
-                    str.append(", ");
-                }
-            }
-            str.append('}');
-            return str.toString();
-        }
-
-        return value.toString();
-    }
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/LoggingProxy.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, 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 jdk.internal.jvmci.hotspot.logging;
-
-import java.lang.reflect.*;
-
-/**
- * A java.lang.reflect proxy that hierarchically logs all method invocations along with their
- * parameters and return values.
- */
-public class LoggingProxy<T> implements InvocationHandler {
-
-    private T delegate;
-
-    public LoggingProxy(T delegate) {
-        this.delegate = delegate;
-    }
-
-    @Override
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-        int argCount = args == null ? 0 : args.length;
-        if (method.getParameterTypes().length != argCount) {
-            throw new RuntimeException("wrong parameter count");
-        }
-        StringBuilder str = new StringBuilder();
-        str.append(method.getReturnType().getSimpleName() + " " + method.getDeclaringClass().getSimpleName() + "." + method.getName() + "(");
-        for (int i = 0; i < argCount; i++) {
-            str.append(i == 0 ? "" : ", ");
-            str.append(Logger.pretty(args[i]));
-        }
-        str.append(")");
-        Logger.startScope(str.toString());
-        final Object result;
-        try {
-            if (args == null) {
-                result = method.invoke(delegate);
-            } else {
-                result = method.invoke(delegate, args);
-            }
-        } catch (InvocationTargetException e) {
-            Logger.endScope(" = Exception " + e.getMessage());
-            throw e.getCause();
-        }
-        Logger.endScope(" = " + Logger.pretty(result));
-        return result;
-    }
-
-    /**
-     * The object returned by this method will implement all interfaces that are implemented by
-     * delegate.
-     */
-    public static <T> T getProxy(Class<T> interf, T delegate) {
-        Class<?>[] interfaces = ProxyUtil.getAllInterfaces(delegate.getClass());
-        Object obj = Proxy.newProxyInstance(interf.getClassLoader(), interfaces, new LoggingProxy<>(delegate));
-        return interf.cast(obj);
-    }
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/logging/ProxyUtil.java	Tue Jul 28 08:46:37 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011, 2015, 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 jdk.internal.jvmci.hotspot.logging;
-
-import java.util.*;
-
-public final class ProxyUtil {
-
-    public static Class<?>[] getAllInterfaces(Class<?> clazz) {
-        HashSet<Class<?>> interfaces = new HashSet<>();
-        getAllInterfaces(clazz, interfaces);
-        return interfaces.toArray(new Class<?>[interfaces.size()]);
-    }
-
-    private static void getAllInterfaces(Class<?> clazz, HashSet<Class<?>> interfaces) {
-        for (Class<?> iface : clazz.getInterfaces()) {
-            if (!interfaces.contains(iface)) {
-                interfaces.add(iface);
-                getAllInterfaces(iface, interfaces);
-            }
-        }
-        if (clazz.getSuperclass() != null) {
-            getAllInterfaces(clazz.getSuperclass(), interfaces);
-        }
-    }
-}
--- a/make/defs.make	Tue Jul 28 08:46:37 2015 -0700
+++ b/make/defs.make	Wed Jul 29 10:36:54 2015 +0200
@@ -369,8 +369,6 @@
 EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_DIR)/jvmci-hotspot.jar
 
 EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory
-EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/jdk.internal.jvmci.hotspot.HotSpotVMEventListener
-EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/jdk.internal.jvmci.debug.TTYStreamProvider
 
 ifneq ("$(wildcard $(SHARED_DIR)/services/jdk.internal.jvmci.hotspot.events.EventProvider)","")
 CONDITIONAL_EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/jdk.internal.jvmci.hotspot.events.EventProvider
--- a/make/jvmci.make	Tue Jul 28 08:46:37 2015 -0700
+++ b/make/jvmci.make	Wed Jul 29 10:36:54 2015 +0200
@@ -145,7 +145,6 @@
 JVMCI_API_SRC += $(shell find jvmci/jdk.internal.jvmci.runtime/src -type f 2> /dev/null)
 JVMCI_API_SRC += $(shell find jvmci/jdk.internal.jvmci.common/src -type f 2> /dev/null)
 JVMCI_API_SRC += $(shell find jvmci/jdk.internal.jvmci.compiler/src -type f 2> /dev/null)
-JVMCI_API_SRC += $(shell find jvmci/jdk.internal.jvmci.debug/src -type f 2> /dev/null)
 
 JVMCI_API_JAR = $(TARGET)/jvmci-api.jar
 
--- a/make/solaris/makefiles/buildtree.make	Tue Jul 28 08:46:37 2015 -0700
+++ b/make/solaris/makefiles/buildtree.make	Wed Jul 29 10:36:54 2015 +0200
@@ -267,6 +267,7 @@
 	[ -n "$(SPEC)" ] && \
 	    echo "include $(SPEC)"; \
 	echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
+	echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
 	echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
 	) > $@
 
--- a/mx.jvmci/suite.py	Tue Jul 28 08:46:37 2015 -0700
+++ b/mx.jvmci/suite.py	Wed Jul 29 10:36:54 2015 +0200
@@ -110,18 +110,6 @@
       "workingSets" : "API,JVMCI",
     },
 
-    "jdk.internal.jvmci.debug" : {
-      "subDir" : "jvmci",
-      "sourceDirs" : ["src"],
-      "checkstyle" : "jdk.internal.jvmci.service",
-      "dependencies" : [
-        "jdk.internal.jvmci.service",
-      ],
-      "annotationProcessors" : ["JVMCI_OPTIONS_PROCESSOR"],
-      "javaCompliance" : "1.8",
-      "workingSets" : "JVMCI,Debug",
-    },
-
     "jdk.internal.jvmci.options" : {
       "subDir" : "jvmci",
       "sourceDirs" : ["src"],
@@ -194,8 +182,8 @@
         "jdk.internal.jvmci.runtime",
         "jdk.internal.jvmci.common",
         "jdk.internal.jvmci.options",
+        "jdk.internal.jvmci.service",
         "jdk.internal.jvmci.runtime",
-        "jdk.internal.jvmci.debug",
       ],
       "annotationProcessors" : [
         "JVMCI_HOTSPOTVMCONFIG_PROCESSOR",
@@ -356,7 +344,6 @@
         "jdk.internal.jvmci.runtime",
         "jdk.internal.jvmci.common",
         "jdk.internal.jvmci.compiler",
-        "jdk.internal.jvmci.debug",
       ],
       "distDependencies" : [
         "JVMCI_OPTIONS",