changeset 13167:787357a6de3e

Merge.
author Doug Simon <doug.simon@oracle.com>
date Tue, 26 Nov 2013 00:09:59 +0100
parents 107fee7fa3bb (diff) 1dd9aa5a9ee5 (current diff)
children 533808334e7b
files
diffstat 14 files changed, 258 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java	Tue Nov 26 00:09:59 2013 +0100
@@ -22,6 +22,8 @@
  */
 package com.oracle.graal.api.meta;
 
+import static java.lang.reflect.Modifier.*;
+
 import java.util.*;
 
 import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType;
@@ -144,6 +146,7 @@
 
         public ProfiledType(ResolvedJavaType item, double probability) {
             super(item, probability);
+            assert !isAbstract(item.getModifiers()) || item.isArray() : item;
         }
 
         /**
--- a/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/KernelTester.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/KernelTester.java	Tue Nov 26 00:09:59 2013 +0100
@@ -88,7 +88,7 @@
 
     static {
         logger = Logger.getLogger(propPkgName);
-        logLevel = Level.parse(System.getProperty("kerneltester.logLevel", "SEVERE"));
+        logLevel = Level.parse(System.getProperty("kerneltester.logLevel", "OFF"));
 
         // This block configure the logger with handler and formatter.
         consoleHandler = new ConsoleHandler();
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java	Tue Nov 26 00:09:59 2013 +0100
@@ -331,10 +331,15 @@
         out[gid] = val;
     }
 
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        HSAILCompilationResult compResult = HSAILCompilationResult.getHSAILCompilationResult(graph);
-        TTY.println("code generated for " + snippet + ":\n" + compResult.getHSAILCode());
+    private void test(final String snippet) {
+        Debug.scope("HSAILTestCode", new Runnable() {
+            StructuredGraph graph = parse(snippet);
+
+            public void run() {
+                HSAILCompilationResult compResult = HSAILCompilationResult.getHSAILCompilationResult(graph);
+                Debug.log("HSAIL code generated for %s:%n%s", snippet, compResult.getHSAILCode());
+            }
+        });
     }
 
     public static void nBodySpill(float[] inxyz, float[] outxyz, float[] invxyz, float[] outvxyz, int gid) {
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticMethod16InArraysTest.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticMethod16InArraysTest.java	Tue Nov 26 00:09:59 2013 +0100
@@ -23,7 +23,10 @@
 
 package com.oracle.graal.compiler.hsail.test;
 
-import org.junit.Test;
+import org.junit.*;
+
+import com.oracle.graal.debug.*;
+import com.oracle.graal.debug.internal.*;
 
 /**
  * Tests the addition of elements from sixteen input arrays.
@@ -60,7 +63,17 @@
      */
     @Test(expected = java.lang.ClassCastException.class)
     public void test() {
-        testGeneratedHsail();
+        DebugConfig debugConfig = DebugScope.getConfig();
+        DebugConfig noInterceptConfig = new DelegatingDebugConfig(debugConfig) {
+            @Override
+            public RuntimeException interceptException(Throwable e) {
+                return null;
+            }
+        };
+
+        try (DebugConfigScope s = Debug.setConfig(noInterceptConfig)) {
+            testGeneratedHsail();
+        }
     }
 
 }
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java	Tue Nov 26 00:09:59 2013 +0100
@@ -107,7 +107,8 @@
 
     public static void sandbox(String name, DebugConfig config, Runnable runnable) {
         if (ENABLED) {
-            DebugScope.getInstance().scope(name, runnable, null, true, config, new Object[0]);
+            DebugConfig sandboxConfig = config == null ? DebugScope.getConfig() : config;
+            DebugScope.getInstance().scope(name, runnable, null, sandboxConfig, new Object[0]);
         } else {
             runnable.run();
         }
@@ -124,7 +125,8 @@
      */
     public static void sandbox(String name, Object[] context, DebugConfig config, Runnable runnable) {
         if (ENABLED) {
-            DebugScope.getInstance().scope(name, runnable, null, true, config, context);
+            DebugConfig sandboxConfig = config == null ? DebugScope.getConfig() : config;
+            DebugScope.getInstance().scope(name, runnable, null, sandboxConfig, context);
         } else {
             runnable.run();
         }
@@ -141,7 +143,8 @@
      */
     public static <T> T sandbox(String name, Object[] context, DebugConfig config, Callable<T> callable) {
         if (ENABLED) {
-            return DebugScope.getInstance().scope(name, null, callable, true, config, context);
+            DebugConfig sandboxConfig = config == null ? DebugScope.getConfig() : config;
+            return DebugScope.getInstance().scope(name, null, callable, sandboxConfig, context);
         } else {
             return DebugScope.call(callable);
         }
@@ -161,7 +164,7 @@
 
     public static void scope(String name, Object[] context, Runnable runnable) {
         if (ENABLED) {
-            DebugScope.getInstance().scope(name, runnable, null, false, null, context);
+            DebugScope.getInstance().scope(name, runnable, null, null, context);
         } else {
             runnable.run();
         }
@@ -181,7 +184,7 @@
 
     public static <T> T scope(String name, Object[] context, Callable<T> callable) {
         if (ENABLED) {
-            return DebugScope.getInstance().scope(name, null, callable, false, null, context);
+            return DebugScope.getInstance().scope(name, null, callable, null, context);
         } else {
             return DebugScope.call(callable);
         }
@@ -376,9 +379,19 @@
         }
     }
 
-    public static void setConfig(DebugConfig config) {
+    /**
+     * Changes the debug configuration for the current thread.
+     * 
+     * @param config new configuration to use for the current thread
+     * @return an object that when {@linkplain DebugConfigScope#close() closed} will restore the
+     *         debug configuration for the current thread to what it was before this method was
+     *         called
+     */
+    public static DebugConfigScope setConfig(DebugConfig config) {
         if (ENABLED) {
-            DebugScope.getInstance().setConfig(config);
+            return new DebugConfigScope(config);
+        } else {
+            return null;
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugConfigScope.java	Tue Nov 26 00:09:59 2013 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2012, 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.debug;
+
+import com.oracle.graal.debug.internal.*;
+
+/**
+ * A utility for scoping a change to the current debug
+ * {@linkplain DebugScope#setConfig(DebugConfig) configuration}. For example:
+ * 
+ * <pre>
+ *     DebugConfig config = ...;
+ *     try (DebugConfigScope s = new DebugConfigScope(config)) {
+ *         // ...
+ *     }
+ * </pre>
+ */
+public class DebugConfigScope implements AutoCloseable {
+
+    private final DebugConfig current;
+
+    /**
+     * Sets the current debug {@linkplain DebugScope#setConfig(DebugConfig) configuration} to a
+     * given value and creates an object that when {@linkplain #close() closed} resets the
+     * configuration to the {@linkplain DebugScope#getConfig() current} configuration.
+     */
+    public DebugConfigScope(DebugConfig config) {
+        this.current = DebugScope.getConfig();
+        DebugScope.getInstance().setConfig(config);
+    }
+
+    public void close() {
+        DebugScope.getInstance().setConfig(current);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DelegatingDebugConfig.java	Tue Nov 26 00:09:59 2013 +0100
@@ -0,0 +1,80 @@
+/*
+ * 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.debug;
+
+import java.io.*;
+import java.util.*;
+
+public class DelegatingDebugConfig implements DebugConfig {
+
+    protected final DebugConfig delegate;
+
+    public DelegatingDebugConfig(DebugConfig delegate) {
+        this.delegate = delegate;
+    }
+
+    @Override
+    public boolean isLogEnabled() {
+        return delegate.isLogEnabled();
+    }
+
+    @Override
+    public boolean isMeterEnabled() {
+        return delegate.isMeterEnabled();
+    }
+
+    @Override
+    public boolean isDumpEnabled() {
+        return delegate.isDumpEnabled();
+    }
+
+    @Override
+    public boolean isTimeEnabled() {
+        return delegate.isTimeEnabled();
+    }
+
+    @Override
+    public RuntimeException interceptException(Throwable e) {
+        return delegate.interceptException(e);
+    }
+
+    @Override
+    public Collection<DebugDumpHandler> dumpHandlers() {
+        return delegate.dumpHandlers();
+    }
+
+    @Override
+    public PrintStream output() {
+        return delegate.output();
+    }
+
+    @Override
+    public void addToContext(Object o) {
+        delegate.addToContext(o);
+    }
+
+    @Override
+    public void removeFromContext(Object o) {
+        delegate.removeFromContext(o);
+    }
+}
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java	Tue Nov 26 00:09:59 2013 +0100
@@ -28,7 +28,7 @@
 
 import com.oracle.graal.debug.*;
 
-public final class DebugScope {
+public final class DebugScope implements AutoCloseable {
 
     private final class IndentImpl implements Indent {
 
@@ -99,6 +99,8 @@
     private static ThreadLocal<Throwable> lastExceptionThrownTL = new ThreadLocal<>();
 
     private final DebugScope parent;
+    private final DebugConfig parentConfig;
+    private final boolean sandbox;
     private IndentImpl lastUsedIndent;
     private boolean logScopeName;
 
@@ -118,7 +120,7 @@
     public static DebugScope getInstance() {
         DebugScope result = instanceTL.get();
         if (result == null) {
-            DebugScope topLevelDebugScope = new DebugScope(Thread.currentThread().getName(), "", null);
+            DebugScope topLevelDebugScope = new DebugScope(Thread.currentThread().getName(), "", null, false);
             instanceTL.set(topLevelDebugScope);
             DebugValueMap.registerTopLevel(topLevelDebugScope.getValueMap());
             return topLevelDebugScope;
@@ -131,8 +133,10 @@
         return configTL.get();
     }
 
-    private DebugScope(String name, String qualifiedName, DebugScope parent, Object... context) {
+    private DebugScope(String name, String qualifiedName, DebugScope parent, boolean sandbox, Object... context) {
         this.parent = parent;
+        this.sandbox = sandbox;
+        this.parentConfig = getConfig();
         this.context = context;
         this.qualifiedName = qualifiedName;
         if (parent != null) {
@@ -162,6 +166,12 @@
         }
     }
 
+    public void close() {
+        context = null;
+        instanceTL.set(parent);
+        setConfig(parentConfig);
+    }
+
     public boolean isDumpEnabled() {
         return dumpEnabled;
     }
@@ -227,32 +237,28 @@
      * @param newName the name of the new scope
      * @param runnable the task to run (must be null iff {@code callable} is not null)
      * @param callable the task to run (must be null iff {@code runnable} is not null)
-     * @param sandbox specifies if the scope is a child of the current scope or a top level scope
-     * @param sandboxConfig the config to use of a new top level scope (ignored if
-     *            {@code sandbox == false})
+     * @param sandboxConfig if non-null, a new top level scope is entered with this configuration
      * @param newContext context objects of the new scope
      * @return the value returned by the task
      */
-    public <T> T scope(String newName, Runnable runnable, Callable<T> callable, boolean sandbox, DebugConfig sandboxConfig, Object[] newContext) {
-        DebugScope oldContext = getInstance();
-        DebugConfig oldConfig = getConfig();
-        DebugScope newChild = null;
-        if (sandbox) {
-            newChild = new DebugScope(newName, newName, null, newContext);
+    public <T> T scope(String newName, Runnable runnable, Callable<T> callable, DebugConfig sandboxConfig, Object[] newContext) {
+        try (DebugScope s = openScope(newName, sandboxConfig, newContext)) {
+            return executeScope(runnable, callable);
+        }
+    }
+
+    public DebugScope openScope(String newName, DebugConfig sandboxConfig, Object... newContext) {
+        DebugScope newScope = null;
+        if (sandboxConfig != null) {
+            newScope = new DebugScope(newName, newName, this, true, newContext);
             setConfig(sandboxConfig);
         } else {
-            newChild = oldContext.createChild(newName, newContext);
+            newScope = this.createChild(newName, newContext);
         }
-        instanceTL.set(newChild);
-        newChild.setLogEnabled(oldContext.isLogEnabled());
-        newChild.updateFlags();
-        try {
-            return executeScope(runnable, callable);
-        } finally {
-            newChild.context = null;
-            instanceTL.set(oldContext);
-            setConfig(oldConfig);
-        }
+        instanceTL.set(newScope);
+        newScope.setLogEnabled(this.isLogEnabled());
+        newScope.updateFlags();
+        return newScope;
     }
 
     private <T> T executeScope(Runnable runnable, Callable<T> callable) {
@@ -315,7 +321,7 @@
                         return new RuntimeException("Exception while intercepting exception", t);
                     }
                 }
-            }, false, null, new Object[]{e});
+            }, null, new Object[]{e});
         }
         return null;
     }
@@ -337,7 +343,7 @@
         if (this.qualifiedName.length() > 0) {
             newQualifiedName = this.qualifiedName + SCOPE_SEP + newName;
         }
-        DebugScope result = new DebugScope(newName, newQualifiedName, this, newContext);
+        DebugScope result = new DebugScope(newName, newQualifiedName, this, false, newContext);
         return result;
     }
 
@@ -360,7 +366,7 @@
 
                     private void selectScope() {
                         while (currentScope != null && currentScope.context.length <= objectIndex) {
-                            currentScope = currentScope.parent;
+                            currentScope = currentScope.sandbox ? null : currentScope.parent;
                             objectIndex = 0;
                         }
                     }
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java	Tue Nov 26 00:09:59 2013 +0100
@@ -693,9 +693,9 @@
                 };
 
                 DebugConfig debugConfig = DebugScope.getConfig();
-                try {
+                DebugConfig fixedConfig = Debug.fixedConfig(false, false, false, false, debugConfig.dumpHandlers(), debugConfig.output());
+                try (DebugConfigScope s = Debug.setConfig(fixedConfig)) {
                     ReentrantNodeIterator.apply(closure, graph.start(), false, null);
-                    Debug.setConfig(Debug.fixedConfig(false, false, false, false, debugConfig.dumpHandlers(), debugConfig.output()));
                     new WriteBarrierVerificationPhase().apply(graph);
                 } catch (AssertionError error) {
                     /*
@@ -704,8 +704,6 @@
                      */
                     Assert.assertTrue(error.getMessage().contains("Write barrier must be present"));
                     return error;
-                } finally {
-                    Debug.setConfig(debugConfig);
                 }
                 return null;
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java	Tue Nov 26 00:09:59 2013 +0100
@@ -214,7 +214,7 @@
     private abstract static class AbstractMethodData implements HotSpotMethodDataAccessor {
 
         /**
-         * Corresponds to DS_RECOMPILE_BIT defined in deoptimization.cpp.
+         * Corresponds to {@code exception_seen_flag}.
          */
         private static final int EXCEPTIONS_MASK = 0x2;
 
@@ -287,17 +287,7 @@
             return 0;
         }
 
-        public StringBuilder appendFlagsTo(StringBuilder sb, HotSpotMethodData data, int pos) {
-            int flags = getFlags(data, pos);
-            if (flags != 0) {
-                sb.append(format("flags(0x%02x)", flags));
-            }
-            return sb;
-        }
-
-        public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
-            return appendFlagsTo(sb, data, pos);
-        }
+        public abstract StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos);
     }
 
     private static class NoMethodData extends AbstractMethodData {
@@ -321,6 +311,11 @@
         public TriState getExceptionSeen(HotSpotMethodData data, int position) {
             return exceptionSeen;
         }
+
+        @Override
+        public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
+            return sb;
+        }
     }
 
     private static class BitData extends AbstractMethodData {
@@ -341,6 +336,11 @@
         public TriState getNullSeen(HotSpotMethodData data, int position) {
             return TriState.get((getFlags(data, position) & BIT_DATA_NULL_SEEN_FLAG) != 0);
         }
+
+        @Override
+        public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
+            return sb.append(format("exception_seen(%s)", getExceptionSeen(data, pos)));
+        }
     }
 
     private static class CounterData extends BitData {
@@ -368,7 +368,7 @@
 
         @Override
         public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
-            return appendFlagsTo(sb, data, pos).append(format("count(%d)", getCounterValue(data, pos)));
+            return sb.append(format("count(%d)", getCounterValue(data, pos)));
         }
     }
 
@@ -403,7 +403,7 @@
 
         @Override
         public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
-            return appendFlagsTo(sb, data, pos).append(format("taken(%d) displacement(%d)", getExecutionCount(data, pos), getTakenDisplacement(data, pos)));
+            return sb.append(format("taken(%d) displacement(%d)", getExecutionCount(data, pos), getTakenDisplacement(data, pos)));
         }
     }
 
@@ -494,9 +494,9 @@
 
         @Override
         public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
-            super.appendTo(sb, data, pos);
             RawItemProfile<ResolvedJavaType> profile = getRawTypeProfile(data, pos);
-            sb.append(format("nonprofiled_count(%d) entries(%d)", getTypesNotRecordedExecutionCount(data, pos), profile.entries));
+            TriState nullSeen = getNullSeen(data, pos);
+            sb.append(format("count(%d) null_seen(%s) nonprofiled_count(%d) entries(%d)", getCounterValue(data, pos), nullSeen, getTypesNotRecordedExecutionCount(data, pos), profile.entries));
             for (int i = 0; i < profile.entries; i++) {
                 long count = profile.counts[i];
                 sb.append(format("%n  %s (%d, %4.2f)", MetaUtil.toJavaName(profile.items[i]), count, (double) count / profile.totalCount));
@@ -619,7 +619,7 @@
         @Override
         public StringBuilder appendTo(StringBuilder sb, HotSpotMethodData data, int pos) {
             RawItemProfile<ResolvedJavaMethod> profile = getRawMethodProfile(data, pos);
-            super.appendTo(sb, data, pos).append(format("%nmethod_entries(%d)", profile.entries));
+            super.appendTo(sb.append(format("exception_seen(%s) ", getExceptionSeen(data, pos))), data, pos).append(format("%nmethod_entries(%d)", profile.entries));
             for (int i = 0; i < profile.entries; i++) {
                 long count = profile.counts[i];
                 sb.append(format("%n  %s (%d, %4.2f)", MetaUtil.format("%H.%n(%p)", profile.items[i]), count, (double) count / profile.totalCount));
@@ -669,8 +669,7 @@
             long taken = data.readUnsignedInt(pos, TAKEN_COUNT_OFFSET);
             long notTaken = data.readUnsignedInt(pos, NOT_TAKEN_COUNT_OFFSET);
             double takenProbability = getBranchTakenProbability(data, pos);
-            return appendFlagsTo(sb, data, pos).append(
-                            format("taken(%d, %4.2f) not_taken(%d, %4.2f) displacement(%d)", taken, takenProbability, notTaken, 1.0D - takenProbability, getTakenDisplacement(data, pos)));
+            return sb.append(format("taken(%d, %4.2f) not_taken(%d, %4.2f) displacement(%d)", taken, takenProbability, notTaken, 1.0D - takenProbability, getTakenDisplacement(data, pos)));
         }
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Tue Nov 26 00:09:59 2013 +0100
@@ -34,6 +34,7 @@
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.api.meta.ProfilingInfo.TriState;
+import com.oracle.graal.debug.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.debug.*;
@@ -282,6 +283,8 @@
         return getCompiledCodeSize() > 0;
     }
 
+    private static final String TraceMethodDataFilter = System.getProperty("graal.traceMethodDataFilter");
+
     @Override
     public ProfilingInfo getProfilingInfo() {
         ProfilingInfo info;
@@ -290,6 +293,10 @@
             long metaspaceMethodData = unsafeReadWord(metaspaceMethod + runtime().getConfig().methodDataOffset);
             if (metaspaceMethodData != 0) {
                 methodData = new HotSpotMethodData(metaspaceMethodData);
+                if (TraceMethodDataFilter != null && MetaUtil.format("%H.%n", this).contains(TraceMethodDataFilter)) {
+                    TTY.println("Raw method data for " + MetaUtil.format("%H.%n(%p)", this) + ":");
+                    TTY.println(methodData.toString());
+                }
             }
         }
 
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Mon Nov 25 17:23:56 2013 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Tue Nov 26 00:09:59 2013 +0100
@@ -1139,10 +1139,7 @@
             }
 
             ResolvedJavaType type = ptypes[0].getType();
-            if (isAbstract(type.getModifiers())) {
-                // In TieredCompilation mode, C1 can generate profiles containing abstract types
-                return null;
-            }
+            assert !isAbstract(type.getModifiers());
             ResolvedJavaMethod concrete = type.resolveMethod(targetMethod);
             if (!checkTargetConditions(data, replacements, invoke, concrete, optimisticOpts)) {
                 return null;
@@ -1213,10 +1210,8 @@
                 int index = concreteMethods.indexOf(concrete);
                 if (index == -1) {
                     notRecordedTypeProbability += type.getProbability();
-                } else if (isAbstract(type.getType().getModifiers())) {
-                    // In TieredCompilation mode, C1 can generate profiles containing abstract types
-                    notRecordedTypeProbability += type.getProbability();
                 } else {
+                    assert !isAbstract(type.getType().getModifiers());
                     usedTypes.add(type);
                     typesToConcretes.add(index);
                 }
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Mon Nov 25 17:23:56 2013 +0100
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Tue Nov 26 00:09:59 2013 +0100
@@ -4340,11 +4340,15 @@
 #endif // PRODUCT
 
 void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) {
-  // A default method's holder is an interface
-  if (known_holder != NULL && known_holder->is_interface()) {
-    assert(known_holder->is_instance_klass() && ((ciInstanceKlass*)known_holder)->has_default_methods(), "should be default method");
-    known_holder = NULL;
+  assert(known_holder == NULL || (known_holder->is_instance_klass() &&
+                                  (!known_holder->is_interface() ||
+                                   ((ciInstanceKlass*)known_holder)->has_default_methods())), "should be default method");
+  if (known_holder != NULL) {
+    if (known_holder->exact_klass() == NULL) {
+      known_holder = compilation()->cha_exact_type(known_holder);
+    }
   }
+
   append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined));
 }
 
--- a/src/share/vm/graal/graalCompilerToGPU.cpp	Mon Nov 25 17:23:56 2013 +0100
+++ b/src/share/vm/graal/graalCompilerToGPU.cpp	Tue Nov 26 00:09:59 2013 +0100
@@ -177,7 +177,9 @@
 
 C2V_VMENTRY(jboolean, deviceInit, (JNIEnv *env, jobject))
   if (gpu::is_available() == false || gpu::has_gpu_linkage() == false) {
-    tty->print_cr("deviceInit - not available / no linkage");
+    if (TraceGPUInteraction) {
+      tty->print_cr("deviceInit - not available / no linkage");
+    }
     return false;
   }
   if (gpu::is_initialized()) {
@@ -190,7 +192,9 @@
 
 C2V_VMENTRY(jint, availableProcessors, (JNIEnv *env, jobject))
   if (gpu::is_available() == false || gpu::has_gpu_linkage() == false) {
-    tty->print_cr("deviceInit - not available / no linkage");
+    if (TraceGPUInteraction) {
+      tty->print_cr("deviceInit - not available / no linkage");
+    }
     return false;
   }
   return gpu::available_processors();