src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
Print this page
*** 21,48 ****
* questions.
*/
package org.graalvm.compiler.jtt;
import static java.lang.reflect.Modifier.isStatic;
-
import java.util.Collections;
import java.util.Set;
- import jdk.vm.ci.code.InstalledCode;
- import jdk.vm.ci.meta.DeoptimizationReason;
- import jdk.vm.ci.meta.JavaConstant;
- import jdk.vm.ci.meta.JavaType;
- import jdk.vm.ci.meta.ResolvedJavaMethod;
-
- import org.junit.Assert;
-
import org.graalvm.compiler.core.common.CompilationIdentifier;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.nodes.ConstantNode;
import org.graalvm.compiler.nodes.ParameterNode;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
/**
* Base class for the JTT tests.
* <p>
* These tests are executed twice: once with arguments passed to the execution and once with the
--- 21,47 ----
* questions.
*/
package org.graalvm.compiler.jtt;
import static java.lang.reflect.Modifier.isStatic;
import java.util.Collections;
import java.util.Set;
import org.graalvm.compiler.core.common.CompilationIdentifier;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.nodes.ConstantNode;
import org.graalvm.compiler.nodes.ParameterNode;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
+ import org.graalvm.compiler.options.OptionValues;
+ import org.junit.Assert;
+
+ import jdk.vm.ci.code.InstalledCode;
+ import jdk.vm.ci.meta.DeoptimizationReason;
+ import jdk.vm.ci.meta.JavaConstant;
+ import jdk.vm.ci.meta.JavaType;
+ import jdk.vm.ci.meta.ResolvedJavaMethod;
/**
* Base class for the JTT tests.
* <p>
* These tests are executed twice: once with arguments passed to the execution and once with the
*** 63,74 ****
public JTTTest() {
Assert.assertNotNull(getCodeCache());
}
@Override
! protected StructuredGraph parseEager(ResolvedJavaMethod m, AllowAssumptions allowAssumptions, CompilationIdentifier compilationId) {
! StructuredGraph graph = super.parseEager(m, allowAssumptions, compilationId);
if (argsToBind != null) {
Object receiver = isStatic(m.getModifiers()) ? null : this;
Object[] args = argsWithReceiver(receiver, argsToBind);
JavaType[] parameterTypes = m.toParameterTypes();
assert parameterTypes.length == args.length;
--- 62,73 ----
public JTTTest() {
Assert.assertNotNull(getCodeCache());
}
@Override
! protected StructuredGraph parseEager(ResolvedJavaMethod m, AllowAssumptions allowAssumptions, CompilationIdentifier compilationId, OptionValues options) {
! StructuredGraph graph = super.parseEager(m, allowAssumptions, compilationId, options);
if (argsToBind != null) {
Object receiver = isStatic(m.getModifiers()) ? null : this;
Object[] args = argsWithReceiver(receiver, argsToBind);
JavaType[] parameterTypes = m.toParameterTypes();
assert parameterTypes.length == args.length;
*** 80,91 ****
}
return graph;
}
@Override
! protected InstalledCode getCode(ResolvedJavaMethod method, StructuredGraph graph) {
! return super.getCode(method, graph, argsToBind != null);
}
Double delta;
@Override
--- 79,90 ----
}
return graph;
}
@Override
! protected InstalledCode getCode(ResolvedJavaMethod method, StructuredGraph graph, boolean forceCompile, boolean installAsDefault, OptionValues options) {
! return super.getCode(method, graph, argsToBind != null, installAsDefault, options);
}
Double delta;
@Override
*** 102,135 ****
this.delta = Double.valueOf(delta);
runTest(name, args);
}
protected void runTest(String name, Object... args) {
! runTest(EMPTY, name, args);
}
protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, String name, Object... args) {
! runTest(shouldNotDeopt, true, false, name, args);
}
! protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, boolean bind, boolean noProfile, String name, Object... args) {
ResolvedJavaMethod method = getResolvedJavaMethod(name);
Object receiver = method.isStatic() ? null : this;
Result expect = executeExpected(method, receiver, args);
if (noProfile) {
method.reprofile();
}
! testAgainstExpected(method, expect, shouldNotDeopt, receiver, args);
if (args.length > 0 && bind) {
if (noProfile) {
method.reprofile();
}
this.argsToBind = args;
! testAgainstExpected(method, expect, shouldNotDeopt, receiver, args);
this.argsToBind = null;
}
}
}
--- 101,138 ----
this.delta = Double.valueOf(delta);
runTest(name, args);
}
protected void runTest(String name, Object... args) {
! runTest(getInitialOptions(), name, args);
! }
!
! protected void runTest(OptionValues options, String name, Object... args) {
! runTest(options, EMPTY, true, false, name, args);
}
protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, String name, Object... args) {
! runTest(getInitialOptions(), shouldNotDeopt, true, false, name, args);
}
! protected void runTest(OptionValues options, Set<DeoptimizationReason> shouldNotDeopt, boolean bind, boolean noProfile, String name, Object... args) {
ResolvedJavaMethod method = getResolvedJavaMethod(name);
Object receiver = method.isStatic() ? null : this;
Result expect = executeExpected(method, receiver, args);
if (noProfile) {
method.reprofile();
}
! testAgainstExpected(options, method, expect, shouldNotDeopt, receiver, args);
if (args.length > 0 && bind) {
if (noProfile) {
method.reprofile();
}
this.argsToBind = args;
! testAgainstExpected(options, method, expect, shouldNotDeopt, receiver, args);
this.argsToBind = null;
}
}
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File