Search in sources :

Example 1 with ExceptionAction

use of org.graalvm.compiler.core.CompilationWrapper.ExceptionAction in project graal by oracle.

the class CompileTheWorldTest method testJDK.

@Test
public void testJDK() throws Throwable {
    ExceptionAction originalBailoutAction = CompilationBailoutAction.getValue(getInitialOptions());
    ExceptionAction originalFailureAction = CompilationFailureAction.getValue(getInitialOptions());
    // Compile a couple classes in rt.jar
    HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime();
    System.setProperty("CompileTheWorld.LimitModules", "java.base");
    OptionValues initialOptions = getInitialOptions();
    EconomicMap<OptionKey<?>, Object> compilationOptions = CompileTheWorld.parseOptions("Inline=false");
    new CompileTheWorld(runtime, (HotSpotGraalCompiler) runtime.getCompiler(), CompileTheWorld.SUN_BOOT_CLASS_PATH, 1, 5, null, null, false, initialOptions, compilationOptions).compile();
    assert CompilationBailoutAction.getValue(initialOptions) == originalBailoutAction;
    assert CompilationFailureAction.getValue(initialOptions) == originalFailureAction;
}
Also used : HotSpotGraalCompiler(org.graalvm.compiler.hotspot.HotSpotGraalCompiler) ExceptionAction(org.graalvm.compiler.core.CompilationWrapper.ExceptionAction) OptionValues(org.graalvm.compiler.options.OptionValues) OptionKey(org.graalvm.compiler.options.OptionKey) HotSpotJVMCIRuntimeProvider(jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider) Test(org.junit.Test) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest)

Aggregations

HotSpotJVMCIRuntimeProvider (jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)1 ExceptionAction (org.graalvm.compiler.core.CompilationWrapper.ExceptionAction)1 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)1 HotSpotGraalCompiler (org.graalvm.compiler.hotspot.HotSpotGraalCompiler)1 OptionKey (org.graalvm.compiler.options.OptionKey)1 OptionValues (org.graalvm.compiler.options.OptionValues)1 Test (org.junit.Test)1