# HG changeset patch # User Doug Simon # Date 1418324556 -3600 # Node ID 54712aa2d3ee2ef2dae152f405968d6f356fa792 # Parent 058cbb02b58c776e2e4e97ab413e06cd246b56fa# Parent 81a26fb13a9e06258c1ddc2b1edc8087c93fa712 Merge. diff -r 058cbb02b58c -r 54712aa2d3ee graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- 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 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 compile(Request request) { - return GraalCompiler.compile(request); - } + return GraalCompiler.compile(request); } protected StructuredGraph lastCompiledGraph; diff -r 058cbb02b58c -r 54712aa2d3ee graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- 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 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 predicate) { + assert runtimeAccessCheck == null || predicate == null : "at most once runtime access check can be active"; runtimeAccessCheck = predicate; }