Mercurial > hg > graal-compiler
changeset 22876:cc788c1189fc
Remove GraalRuntimeAccess mechanism, and move Graal singleton class to test project.
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/Graal.java Thu Oct 22 16:00:44 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.runtime; - -import java.util.Formatter; - -import jdk.vm.ci.service.Services; - -/** - * Access point for {@linkplain #getRuntime() retrieving} the single {@link GraalRuntime} instance. - */ -public class Graal { - - private static final class Lazy { - private static final GraalRuntime runtime = initializeRuntime(); - - private static GraalRuntime initializeRuntime() { - GraalRuntimeAccess access = Services.loadSingle(GraalRuntimeAccess.class, false); - if (access != null) { - GraalRuntime rt = access.getRuntime(); - assert rt != null; - return rt; - } - return new InvalidGraalRuntime(); - } - } - - /** - * Gets the singleton {@link GraalRuntime} instance available to the application. - */ - public static GraalRuntime getRuntime() { - return Lazy.runtime; - } - - /** - * Gets a capability provided by the {@link GraalRuntime} instance available to the application. - * - * @throws UnsupportedOperationException if the capability is not available - */ - public static <T> T getRequiredCapability(Class<T> clazz) { - T t = getRuntime().getCapability(clazz); - if (t == null) { - String javaHome = System.getProperty("java.home"); - String vmName = System.getProperty("java.vm.name"); - Formatter errorMessage = new Formatter(); - if (getRuntime().getClass() == InvalidGraalRuntime.class) { - errorMessage.format("The VM does not support the Graal API.%n"); - } else { - errorMessage.format("The VM does not expose required Graal capability %s.%n", clazz.getName()); - } - errorMessage.format("Currently used Java home directory is %s.%n", javaHome); - errorMessage.format("Currently used VM configuration is: %s", vmName); - throw new UnsupportedOperationException(errorMessage.toString()); - } - return t; - } - - private static final class InvalidGraalRuntime implements GraalRuntime { - - @Override - public String getName() { - return ""; - } - - @Override - public <T> T getCapability(Class<T> clazz) { - return null; - } - } -}
--- a/graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/GraalRuntimeAccess.java Thu Oct 22 16:00:44 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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 com.oracle.graal.api.runtime; - -/** - * A service that provides access to a {@link GraalRuntime} implementation. - */ -public interface GraalRuntimeAccess { - - /** - * Gets the {@link GraalRuntime} implementation available via this access object. - */ - GraalRuntime getRuntime(); -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.test/src/com/oracle/graal/api/test/Graal.java Thu Oct 22 16:21:29 2015 +0200 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2012, 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 com.oracle.graal.api.test; + +import java.util.Formatter; + +import jdk.vm.ci.runtime.JVMCI; +import jdk.vm.ci.runtime.JVMCICompiler; + +import com.oracle.graal.api.runtime.GraalJVMCICompiler; +import com.oracle.graal.api.runtime.GraalRuntime; + +/** + * Access point for {@linkplain #getRuntime() retrieving} the {@link GraalRuntime} instance of the + * system compiler from unit tests. + */ +public class Graal { + + private static final GraalRuntime runtime = initializeRuntime(); + + private static GraalRuntime initializeRuntime() { + JVMCICompiler compiler = JVMCI.getRuntime().getCompiler(); + if (compiler instanceof GraalJVMCICompiler) { + GraalJVMCICompiler graal = (GraalJVMCICompiler) compiler; + return graal.getGraalRuntime(); + } else { + return new InvalidGraalRuntime(); + } + } + + /** + * Gets the singleton {@link GraalRuntime} instance available to unit tests. + */ + public static GraalRuntime getRuntime() { + return runtime; + } + + /** + * Gets a capability provided by the {@link GraalRuntime} instance available to the application. + * + * @throws UnsupportedOperationException if the capability is not available + */ + public static <T> T getRequiredCapability(Class<T> clazz) { + T t = getRuntime().getCapability(clazz); + if (t == null) { + String javaHome = System.getProperty("java.home"); + String vmName = System.getProperty("java.vm.name"); + Formatter errorMessage = new Formatter(); + if (getRuntime().getClass() == InvalidGraalRuntime.class) { + errorMessage.format("The VM does not support the Graal API.%n"); + } else { + errorMessage.format("The VM does not expose required Graal capability %s.%n", clazz.getName()); + } + errorMessage.format("Currently used Java home directory is %s.%n", javaHome); + errorMessage.format("Currently used VM configuration is: %s", vmName); + throw new UnsupportedOperationException(errorMessage.toString()); + } + return t; + } + + private static final class InvalidGraalRuntime implements GraalRuntime { + + @Override + public String getName() { + return ""; + } + + @Override + public <T> T getCapability(Class<T> clazz) { + return null; + } + } +}
--- a/graal/com.oracle.graal.api.test/src/com/oracle/graal/api/test/GraalAPITest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.api.test/src/com/oracle/graal/api/test/GraalAPITest.java Thu Oct 22 16:21:29 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -26,8 +26,6 @@ import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; - public class GraalAPITest { @Test
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Thu Oct 22 16:21:29 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -57,7 +57,7 @@ import org.junit.Assume; import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.CompilerThreadFactory; import com.oracle.graal.compiler.CompilerThreadFactory.DebugConfigAccess; import com.oracle.graal.compiler.common.type.ArithmeticOpTable;
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -69,7 +69,7 @@ import com.oracle.graal.api.directives.GraalDirectives; import com.oracle.graal.api.replacements.SnippetReflectionProvider; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.GraalCompiler; import com.oracle.graal.compiler.GraalCompiler.Request; import com.oracle.graal.compiler.target.Backend;
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/StaticInterfaceFieldTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/StaticInterfaceFieldTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -32,7 +32,7 @@ import org.junit.Assume; import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.debug.Debug; import com.oracle.graal.debug.DebugConfigScope; import com.oracle.graal.debug.DelegatingDebugConfig;
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/InvokeGraal.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/InvokeGraal.java Thu Oct 22 16:21:29 2015 +0200 @@ -35,7 +35,7 @@ import jdk.vm.ci.meta.ProfilingInfo; import jdk.vm.ci.meta.ResolvedJavaMethod; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.GraalCompiler; import com.oracle.graal.compiler.target.Backend; import com.oracle.graal.debug.Debug;
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysisTests.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysisTests.java Thu Oct 22 16:21:29 2015 +0200 @@ -35,7 +35,7 @@ import org.junit.Assert; import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.target.Backend; import com.oracle.graal.compiler.test.tutorial.StaticAnalysis.MethodState; import com.oracle.graal.compiler.test.tutorial.StaticAnalysis.TypeFlow;
--- a/graal/com.oracle.graal.graph.test/src/com/oracle/graal/graph/test/NodeMapTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.graph.test/src/com/oracle/graal/graph/test/NodeMapTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -28,7 +28,7 @@ import org.junit.Before; import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.graph.Graph; import com.oracle.graal.graph.Node; import com.oracle.graal.graph.NodeClass;
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -41,7 +41,7 @@ import org.junit.Ignore; import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.common.type.Stamp; import com.oracle.graal.compiler.test.GraalCompilerTest; import com.oracle.graal.graph.iterators.NodeIterable;
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ForeignCallDeoptimizeTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ForeignCallDeoptimizeTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -26,7 +26,7 @@ import com.oracle.graal.api.replacements.ClassSubstitution; import com.oracle.graal.api.replacements.MethodSubstitution; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.common.spi.ForeignCallDescriptor; import com.oracle.graal.compiler.test.GraalCompilerTest; import com.oracle.graal.graph.Node.ConstantNodeParameter;
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java Thu Oct 22 16:21:29 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,7 +29,7 @@ import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCICompiler; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.test.AllocSpy; import com.oracle.graal.debug.Debug; import com.oracle.graal.debug.DebugEnvironment;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeAccess.java Thu Oct 22 16:00:44 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +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 com.oracle.graal.hotspot; - -import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.runtime.JVMCICompilerFactory; -import jdk.vm.ci.service.ServiceProvider; -import jdk.vm.ci.service.Services; - -import com.oracle.graal.api.runtime.GraalRuntime; -import com.oracle.graal.api.runtime.GraalRuntimeAccess; - -@ServiceProvider(GraalRuntimeAccess.class) -public class HotSpotGraalRuntimeAccess implements GraalRuntimeAccess { - - static class Options { - // @formatter:off - @Option(help = "Select a graal compiler for hosted compilation (default: use JVMCI system compiler).") - public static final OptionValue<String> HostedCompiler = new OptionValue<>(null); - // @formatter:on - } - - @Override - public GraalRuntime getRuntime() { - HotSpotGraalCompiler compiler = getCompiler(Options.HostedCompiler.getValue()); - return compiler.getGraalRuntime(); - } - - private static HotSpotGraalCompiler getCompiler(String config) { - HotSpotJVMCIRuntimeProvider jvmciRuntime = HotSpotJVMCIRuntime.runtime(); - if (config == null) { - // default: fall back to the JVMCI system compiler - return (HotSpotGraalCompiler) jvmciRuntime.getCompiler(); - } else { - for (JVMCICompilerFactory factory : Services.load(JVMCICompilerFactory.class)) { - if (factory instanceof HotSpotGraalCompilerFactory) { - HotSpotGraalCompilerFactory graalFactory = (HotSpotGraalCompilerFactory) factory; - if (config.equals(factory.getCompilerName())) { - return graalFactory.createCompiler(jvmciRuntime); - } - } - } - throw new JVMCIError("Graal compiler configuration '" + config + "' not found"); - } - } -}
--- a/graal/com.oracle.graal.microbenchmarks/src/com/oracle/graal/microbenchmarks/graal/util/GraalState.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.microbenchmarks/src/com/oracle/graal/microbenchmarks/graal/util/GraalState.java Thu Oct 22 16:21:29 2015 +0200 @@ -27,7 +27,7 @@ import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.State; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.target.Backend; import com.oracle.graal.phases.util.Providers; import com.oracle.graal.runtime.RuntimeProvider;
--- a/graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -30,7 +30,7 @@ import org.junit.Assert; import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.common.type.Stamp; import com.oracle.graal.compiler.common.type.StampFactory; import com.oracle.graal.runtime.RuntimeProvider;
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ReplacementsParseTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ReplacementsParseTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -30,7 +30,7 @@ import com.oracle.graal.api.replacements.ClassSubstitution; import com.oracle.graal.api.replacements.MethodSubstitution; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.compiler.test.GraalCompilerTest; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic;
--- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/TruffleRuntimeTest.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/TruffleRuntimeTest.java Thu Oct 22 16:21:29 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -27,7 +27,7 @@ import org.junit.Test; -import com.oracle.graal.api.runtime.Graal; +import com.oracle.graal.api.test.Graal; import com.oracle.graal.runtime.RuntimeProvider; import com.oracle.truffle.api.Truffle; import com.oracle.truffle.api.TruffleRuntime;
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/DefaultTruffleCompiler.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/DefaultTruffleCompiler.java Thu Oct 22 16:21:29 2015 +0200 @@ -37,8 +37,6 @@ public final class DefaultTruffleCompiler extends TruffleCompiler { - private final SnippetReflectionProvider snippetReflection; - public static TruffleCompiler create(GraalTruffleRuntime runtime) { Backend backend = runtime.getRequiredGraalCapability(RuntimeProvider.class).getHostBackend(); Suites suites = backend.getSuites().getDefaultSuites(); @@ -50,8 +48,7 @@ } private DefaultTruffleCompiler(Plugins plugins, Suites suites, LIRSuites lirSuites, Backend backend, SnippetReflectionProvider snippetReflection) { - super(plugins, suites, lirSuites, backend); - this.snippetReflection = snippetReflection; + super(plugins, suites, lirSuites, backend, snippetReflection); } @Override
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompiler.java Thu Oct 22 16:00:44 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompiler.java Thu Oct 22 16:21:29 2015 +0200 @@ -42,6 +42,7 @@ import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.SpeculationLog; +import com.oracle.graal.api.replacements.SnippetReflectionProvider; import com.oracle.graal.compiler.target.Backend; import com.oracle.graal.debug.Debug; import com.oracle.graal.debug.Debug.Scope; @@ -76,6 +77,7 @@ protected final LIRSuites lirSuites; protected final PartialEvaluator partialEvaluator; protected final Backend backend; + protected final SnippetReflectionProvider snippetReflection; protected final GraalTruffleCompilationListener compilationNotify; // @formatter:off @@ -93,10 +95,11 @@ public static final OptimisticOptimizations Optimizations = OptimisticOptimizations.ALL.remove(OptimisticOptimizations.Optimization.UseExceptionProbability, OptimisticOptimizations.Optimization.RemoveNeverExecutedCode, OptimisticOptimizations.Optimization.UseTypeCheckedInlining, OptimisticOptimizations.Optimization.UseTypeCheckHints); - public TruffleCompiler(Plugins plugins, Suites suites, LIRSuites lirSuites, Backend backend) { + public TruffleCompiler(Plugins plugins, Suites suites, LIRSuites lirSuites, Backend backend, SnippetReflectionProvider snippetReflection) { GraalTruffleRuntime graalTruffleRuntime = ((GraalTruffleRuntime) Truffle.getRuntime()); this.compilationNotify = graalTruffleRuntime.getCompilationNotify(); this.backend = backend; + this.snippetReflection = snippetReflection; Providers backendProviders = backend.getProviders(); ConstantReflectionProvider constantReflection = new TruffleConstantReflectionProvider(backendProviders.getConstantReflection(), backendProviders.getMetaAccess()); this.providers = backendProviders.copyWith(constantReflection);
--- a/mx.graal/suite.py Thu Oct 22 16:00:44 2015 +0200 +++ b/mx.graal/suite.py Thu Oct 22 16:21:29 2015 +0200 @@ -299,7 +299,7 @@ "checkstyle" : "com.oracle.graal.graph", "dependencies" : [ "mx:JUNIT", - "com.oracle.graal.api.runtime", + "com.oracle.graal.api.test", "com.oracle.graal.graph", ], "annotationProcessors" : ["GRAAL_NODEINFO_PROCESSOR"], @@ -571,7 +571,7 @@ "subDir" : "graal", "sourceDirs" : ["src"], "dependencies" : [ - "com.oracle.graal.api.runtime", + "com.oracle.graal.api.test", "com.oracle.graal.runtime", "mx:JUNIT", ], @@ -608,7 +608,7 @@ "sourceDirs" : ["src"], "dependencies" : [ "JMH", - "com.oracle.graal.api.runtime", + "com.oracle.graal.api.test", "com.oracle.graal.java", "com.oracle.graal.runtime", ],