Search in sources :

Example 1 with HotSpotClassInitializationPlugin

use of org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin in project graal by oracle.

the class ReplaceConstantNodesPhaseTest method getDefaultGraphBuilderPlugins.

@Override
protected Plugins getDefaultGraphBuilderPlugins() {
    Plugins plugins = super.getDefaultGraphBuilderPlugins();
    plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
    return plugins;
}
Also used : HotSpotClassInitializationPlugin(org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin) Plugins(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)

Example 2 with HotSpotClassInitializationPlugin

use of org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin in project graal by oracle.

the class EliminateRedundantInitializationPhaseTest method getDefaultGraphBuilderPlugins.

@Override
protected Plugins getDefaultGraphBuilderPlugins() {
    Plugins plugins = super.getDefaultGraphBuilderPlugins();
    plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
    return plugins;
}
Also used : HotSpotClassInitializationPlugin(org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin) Plugins(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)

Example 3 with HotSpotClassInitializationPlugin

use of org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin in project graal by oracle.

the class HotSpotInvokeDynamicPluginTest method getDefaultGraphBuilderPlugins.

@Override
protected Plugins getDefaultGraphBuilderPlugins() {
    Plugins plugins = super.getDefaultGraphBuilderPlugins();
    plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin());
    plugins.setInvokeDynamicPlugin(new HotSpotInvokeDynamicPlugin() {

        @Override
        public boolean isResolvedDynamicInvoke(GraphBuilderContext builder, int index, int opcode) {
            // Allow invokedynamic testing with older JVMCI
            ResolvedJavaMethod m = builder.getMethod();
            if (m.getName().startsWith("invokeDynamic") && m.getDeclaringClass().getName().equals("Lorg/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest;")) {
                return false;
            }
            return super.isResolvedDynamicInvoke(builder, index, opcode);
        }

        @Override
        public boolean supportsDynamicInvoke(GraphBuilderContext builder, int index, int opcode) {
            // Allow invokehandle testing with older JVMCI
            ResolvedJavaMethod m = builder.getMethod();
            if (m.getName().startsWith("invokeHandle") && m.getDeclaringClass().getName().equals("Lorg/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest;")) {
                return true;
            }
            return super.supportsDynamicInvoke(builder, index, opcode);
        }
    });
    return plugins;
}
Also used : HotSpotInvokeDynamicPlugin(org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin) HotSpotClassInitializationPlugin(org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin) GraphBuilderContext(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod) Plugins(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)

Aggregations

HotSpotClassInitializationPlugin (org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin)3 Plugins (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)3 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 HotSpotInvokeDynamicPlugin (org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin)1 GraphBuilderContext (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext)1