22 */ 23 24 package org.graalvm.compiler.hotspot.test; 25 26 import static org.graalvm.compiler.core.common.util.ModuleAPI.addExports; 27 import static org.graalvm.compiler.core.common.util.ModuleAPI.getModule; 28 29 import java.lang.reflect.Method; 30 31 import org.graalvm.compiler.core.common.util.Util; 32 import org.graalvm.compiler.core.test.GraalCompilerTest; 33 import org.graalvm.compiler.debug.Debug; 34 import org.graalvm.compiler.debug.Debug.Scope; 35 import org.graalvm.compiler.graph.Node; 36 import org.graalvm.compiler.nodes.Invoke; 37 import org.graalvm.compiler.nodes.StructuredGraph; 38 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; 39 import org.junit.BeforeClass; 40 import org.junit.Test; 41 42 import jdk.internal.org.objectweb.asm.ClassWriter; 43 import jdk.internal.org.objectweb.asm.MethodVisitor; 44 import jdk.internal.org.objectweb.asm.Opcodes; 45 import jdk.vm.ci.meta.ResolvedJavaMethod; 46 47 public class ConstantPoolSubstitutionsTests extends GraalCompilerTest implements Opcodes { 48 49 @SuppressWarnings("try") 50 protected StructuredGraph test(final String snippet) { 51 ResolvedJavaMethod method = getMetaAccess().lookupJavaMethod(getMethod(snippet)); 52 try (Scope s = Debug.scope("ConstantPoolSubstitutionsTests", method)) { 53 StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES); 54 compile(graph.method(), graph); 55 assertNotInGraph(graph, Invoke.class); 56 Debug.dump(Debug.BASIC_LOG_LEVEL, graph, snippet); 57 return graph; 58 } catch (Throwable e) { 59 throw Debug.handle(e); 60 } 61 } 62 63 protected static StructuredGraph assertNotInGraph(StructuredGraph graph, Class<?> clazz) { 64 for (Node node : graph.getNodes()) { | 22 */ 23 24 package org.graalvm.compiler.hotspot.test; 25 26 import static org.graalvm.compiler.core.common.util.ModuleAPI.addExports; 27 import static org.graalvm.compiler.core.common.util.ModuleAPI.getModule; 28 29 import java.lang.reflect.Method; 30 31 import org.graalvm.compiler.core.common.util.Util; 32 import org.graalvm.compiler.core.test.GraalCompilerTest; 33 import org.graalvm.compiler.debug.Debug; 34 import org.graalvm.compiler.debug.Debug.Scope; 35 import org.graalvm.compiler.graph.Node; 36 import org.graalvm.compiler.nodes.Invoke; 37 import org.graalvm.compiler.nodes.StructuredGraph; 38 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; 39 import org.junit.BeforeClass; 40 import org.junit.Test; 41 42 import org.objectweb.asm.ClassWriter; 43 import org.objectweb.asm.MethodVisitor; 44 import org.objectweb.asm.Opcodes; 45 import jdk.vm.ci.meta.ResolvedJavaMethod; 46 47 public class ConstantPoolSubstitutionsTests extends GraalCompilerTest implements Opcodes { 48 49 @SuppressWarnings("try") 50 protected StructuredGraph test(final String snippet) { 51 ResolvedJavaMethod method = getMetaAccess().lookupJavaMethod(getMethod(snippet)); 52 try (Scope s = Debug.scope("ConstantPoolSubstitutionsTests", method)) { 53 StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES); 54 compile(graph.method(), graph); 55 assertNotInGraph(graph, Invoke.class); 56 Debug.dump(Debug.BASIC_LOG_LEVEL, graph, snippet); 57 return graph; 58 } catch (Throwable e) { 59 throw Debug.handle(e); 60 } 61 } 62 63 protected static StructuredGraph assertNotInGraph(StructuredGraph graph, Class<?> clazz) { 64 for (Node node : graph.getNodes()) { |