changeset 18664:54712aa2d3ee

Merge.
author Doug Simon <doug.simon@oracle.com>
date Thu, 11 Dec 2014 20:02:36 +0100
parents 058cbb02b58c (current diff) 81a26fb13a9e (diff)
children 96861e3f8cc5
files
diffstat 2 files changed, 8 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Thu Dec 11 19:35:44 2014 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Thu Dec 11 20:02:36 2014 +0100
@@ -686,28 +686,7 @@
         CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graphToCompile.method(), false);
         Request<CompilationResult> request = new Request<>(graphToCompile, null, cc, installedCodeOwner, getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(),
                         OptimisticOptimizations.ALL, getProfilingInfo(graphToCompile), getSpeculationLog(), getSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default);
-        return compiler.compile(request);
-    }
-
-    public static final Compiler DEFAULT_COMPILER = new Compiler();
-
-    private static Compiler compiler = DEFAULT_COMPILER;
-
-    public static Compiler getCompiler() {
-        return compiler;
-    }
-
-    public static void setCompiler(Compiler comp) {
-        compiler = comp;
-    }
-
-    /**
-     * Pluggable compiler for servicing a compilation {@link Request}.
-     */
-    public static class Compiler {
-        public <T extends CompilationResult> T compile(Request<T> request) {
-            return GraalCompiler.compile(request);
-        }
+        return GraalCompiler.compile(request);
     }
 
     protected StructuredGraph lastCompiledGraph;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Thu Dec 11 19:35:44 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Thu Dec 11 20:02:36 2014 +0100
@@ -82,7 +82,14 @@
 
     private static Predicate<Void> runtimeAccessCheck;
 
+    /**
+     * Sets a predicate which will be used to assert a valid calling context for a call to
+     * {@link #runtime()}. This is useful for verifying execution scopes that should not make a
+     * static access to {@link HotSpotGraalRuntime}. Such scopes are responsible for resetting the
+     * predicate to null.
+     */
     public static void setRuntimeAccessCheck(Predicate<Void> predicate) {
+        assert runtimeAccessCheck == null || predicate == null : "at most once runtime access check can be active";
         runtimeAccessCheck = predicate;
     }