Search in sources :

Example 66 with OptionValues

use of org.graalvm.compiler.options.OptionValues in project graal by oracle.

the class GraalOSRLockTest method testLockOSRRecursive.

@Test
@SuppressWarnings("try")
public void testLockOSRRecursive() {
    run(() -> {
        // call it
        testRecursiveLockingLeaf();
        ResolvedJavaMethod leaf = getResolvedJavaMethod("testRecursiveLockingLeaf");
        // profile it
        leaf.reprofile();
        testRecursiveLockingLeaf();
        EconomicMap<OptionKey<?>, Object> overrides = osrLockNoDeopt();
        overrides.put(HighTier.Options.Inline, false);
        OptionValues options = new OptionValues(getInitialOptions(), overrides);
        DebugContext debug = getDebugContext(options);
        compile(debug, leaf, -1);
        testOSR(options, "testRecursiveLockingRoot");
    });
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues) OptionKey(org.graalvm.compiler.options.OptionKey) DebugContext(org.graalvm.compiler.debug.DebugContext) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) Test(org.junit.Test)

Example 67 with OptionValues

use of org.graalvm.compiler.options.OptionValues in project graal by oracle.

the class GraalOSRLockTest method testLockOSROuterImmediateDeoptAfter.

// @Test
@SuppressWarnings("try")
public void testLockOSROuterImmediateDeoptAfter() {
    run(() -> {
        OptionValues options = new OptionValues(getInitialOptions(), osrLockDeopt());
        testOSR(options, "testOuterLockImmediateDeoptAfter");
    });
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues)

Example 68 with OptionValues

use of org.graalvm.compiler.options.OptionValues in project graal by oracle.

the class GraalOSRLockTest method testLockOSRRecursiveLeafOSR.

@Test
@SuppressWarnings("try")
public void testLockOSRRecursiveLeafOSR() {
    run(() -> {
        testRecursiveRootNoOSR();
        ResolvedJavaMethod root = getResolvedJavaMethod("testRecursiveRootNoOSR");
        EconomicMap<OptionKey<?>, Object> overrides = osrLockNoDeopt();
        overrides.put(HighTier.Options.Inline, false);
        OptionValues options = new OptionValues(getInitialOptions(), overrides);
        DebugContext debug = getDebugContext(options);
        compile(debug, root, -1);
        testOSR(options, "testRecursiveLeafOSR");
        // force a safepoint and hope the inflated locks are deflated
        System.gc();
        // call the root to call into the leaf and enter the osr-ed code
        testRecursiveRootNoOSR();
    });
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues) OptionKey(org.graalvm.compiler.options.OptionKey) DebugContext(org.graalvm.compiler.debug.DebugContext) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) Test(org.junit.Test)

Example 69 with OptionValues

use of org.graalvm.compiler.options.OptionValues in project graal by oracle.

the class GraalOSRLockTest method testLockOSROuterInnerLockDepthRecursiveCompileRestOfMethod0.

@Test
@SuppressWarnings("try")
public void testLockOSROuterInnerLockDepthRecursiveCompileRestOfMethod0() {
    run(() -> {
        OptionValues options = new OptionValues(getInitialOptions(), osrLockNoDeopt());
        testOSR(options, "testOuterInnerLockDepth1RecursiveCompileRestOfMethod1");
    });
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues) Test(org.junit.Test)

Example 70 with OptionValues

use of org.graalvm.compiler.options.OptionValues in project graal by oracle.

the class CompileTheWorld method loadOptions.

public static OptionValues loadOptions(OptionValues initialValues) {
    EconomicMap<OptionKey<?>, Object> values = OptionValues.newOptionMap();
    List<OptionDescriptors> loader = singletonList(DESCRIPTORS);
    OptionsParser.parseOptions(extractEntries(System.getProperties(), "CompileTheWorld.", true), values, loader);
    OptionValues options = new OptionValues(initialValues, values);
    if (Options.Help.getValue(options)) {
        options.printHelp(loader, System.out, "CompileTheWorld.");
        System.exit(0);
    }
    return options;
}
Also used : OptionValues(org.graalvm.compiler.options.OptionValues) OptionKey(org.graalvm.compiler.options.OptionKey) ReflectionOptionDescriptors(org.graalvm.compiler.core.test.ReflectionOptionDescriptors) OptionDescriptors(org.graalvm.compiler.options.OptionDescriptors)

Aggregations

OptionValues (org.graalvm.compiler.options.OptionValues)158 Test (org.junit.Test)65 DebugContext (org.graalvm.compiler.debug.DebugContext)50 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)36 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)30 Graph (org.graalvm.compiler.graph.Graph)22 OptionKey (org.graalvm.compiler.options.OptionKey)16 HighTierContext (org.graalvm.compiler.phases.tiers.HighTierContext)13 Plugins (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)11 GraphBuilderConfiguration (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration)10 InvocationPlugins (org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins)10 CanonicalizerPhase (org.graalvm.compiler.phases.common.CanonicalizerPhase)10 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)9 DebugCloseable (org.graalvm.compiler.debug.DebugCloseable)9 GraphBuilderPhase (org.graalvm.compiler.java.GraphBuilderPhase)9 Providers (org.graalvm.compiler.phases.util.Providers)9 IOException (java.io.IOException)8 Method (java.lang.reflect.Method)8 CompilationResult (org.graalvm.compiler.code.CompilationResult)7 CompilationIdentifier (org.graalvm.compiler.core.common.CompilationIdentifier)7