src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
29 import java.lang.invoke.MethodType; |
29 import java.lang.invoke.MethodType; |
30 import java.security.PrivilegedAction; |
30 import java.security.PrivilegedAction; |
31 import java.util.function.IntPredicate; |
31 import java.util.function.IntPredicate; |
32 |
32 |
33 import org.graalvm.compiler.core.common.GraalOptions; |
33 import org.graalvm.compiler.core.common.GraalOptions; |
34 import org.graalvm.compiler.hotspot.meta.HotSpotClassInitializationPlugin; |
34 import org.graalvm.compiler.hotspot.meta.HotSpotAOTClassInitializationPlugin; |
35 import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin; |
35 import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin; |
36 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicConstantNode; |
36 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicConstantNode; |
37 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicStubCall; |
37 import org.graalvm.compiler.hotspot.nodes.aot.ResolveDynamicStubCall; |
38 import org.graalvm.compiler.nodes.StructuredGraph; |
38 import org.graalvm.compiler.nodes.StructuredGraph; |
39 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
39 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
57 |
57 |
58 public class HotSpotInvokeDynamicPluginTest extends HotSpotGraalCompilerTest { |
58 public class HotSpotInvokeDynamicPluginTest extends HotSpotGraalCompilerTest { |
59 @Override |
59 @Override |
60 protected Plugins getDefaultGraphBuilderPlugins() { |
60 protected Plugins getDefaultGraphBuilderPlugins() { |
61 Plugins plugins = super.getDefaultGraphBuilderPlugins(); |
61 Plugins plugins = super.getDefaultGraphBuilderPlugins(); |
62 plugins.setClassInitializationPlugin(new HotSpotClassInitializationPlugin()); |
62 plugins.setClassInitializationPlugin(new HotSpotAOTClassInitializationPlugin()); |
63 plugins.setInvokeDynamicPlugin(new HotSpotInvokeDynamicPlugin() { |
63 plugins.setInvokeDynamicPlugin(new HotSpotInvokeDynamicPlugin() { |
64 @Override |
64 @Override |
65 public boolean isResolvedDynamicInvoke(GraphBuilderContext builder, int index, int opcode) { |
65 public boolean isResolvedDynamicInvoke(GraphBuilderContext builder, int index, int opcode) { |
66 // Allow invokedynamic testing with older JVMCI |
66 // Allow invokedynamic testing with older JVMCI |
67 ResolvedJavaMethod m = builder.getMethod(); |
67 ResolvedJavaMethod m = builder.getMethod(); |