src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java Thu Nov 15 21:05:47 2018 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java Thu Nov 15 09:04:07 2018 -0800
@@ -65,9 +65,14 @@
@SuppressWarnings("try")
protected StructuredGraph testGraph(final String snippet, String name) {
+ return testGraph(getResolvedJavaMethod(snippet), name);
+ }
+
+ @SuppressWarnings("try")
+ protected StructuredGraph testGraph(final ResolvedJavaMethod method, String name) {
DebugContext debug = getDebugContext();
- try (DebugContext.Scope s = debug.scope("MethodSubstitutionTest", getResolvedJavaMethod(snippet))) {
- StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES, debug);
+ try (DebugContext.Scope s = debug.scope("MethodSubstitutionTest", method)) {
+ StructuredGraph graph = parseEager(method, AllowAssumptions.YES, debug);
HighTierContext context = getDefaultHighTierContext();
debug.dump(DebugContext.BASIC_LEVEL, graph, "Graph");
createInliningPhase(graph).apply(graph, context);
@@ -111,7 +116,8 @@
return graph;
}
- protected void testSubstitution(String testMethodName, Class<?> intrinsicClass, Class<?> holder, String methodName, Class<?>[] parameterTypes, boolean optional, Object[] args1, Object[] args2) {
+ protected void testSubstitution(String testMethodName, Class<?> intrinsicClass, Class<?> holder, String methodName, Class<?>[] parameterTypes, boolean optional, boolean forceCompilation,
+ Object[] args1, Object[] args2) {
ResolvedJavaMethod realMethod = getResolvedJavaMethod(holder, methodName, parameterTypes);
ResolvedJavaMethod testMethod = getResolvedJavaMethod(testMethodName);
StructuredGraph graph = testGraph(testMethodName);
@@ -123,7 +129,7 @@
}
// Force compilation
- InstalledCode code = getCode(testMethod);
+ InstalledCode code = getCode(testMethod, null, forceCompilation);
assert optional || code != null;
for (int i = 0; i < args1.length; i++) {