src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.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.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
Print this page
*** 27,44 ****
import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED;
import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_IGNORED;
import java.util.function.Consumer;
- import org.junit.Test;
-
import org.graalvm.compiler.code.CompilationResult;
import org.graalvm.compiler.core.common.LIRKind;
import org.graalvm.compiler.core.common.type.StampFactory;
import org.graalvm.compiler.core.test.GraalCompilerTest;
! import org.graalvm.compiler.debug.Debug;
! import org.graalvm.compiler.debug.DebugConfigScope;
import org.graalvm.compiler.graph.NodeClass;
import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
import org.graalvm.compiler.lir.FullInfopointOp;
import org.graalvm.compiler.lir.LIRFrameState;
import org.graalvm.compiler.lir.LIRInstruction;
--- 27,43 ----
import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED;
import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_IGNORED;
import java.util.function.Consumer;
import org.graalvm.compiler.code.CompilationResult;
import org.graalvm.compiler.core.common.LIRKind;
import org.graalvm.compiler.core.common.type.StampFactory;
import org.graalvm.compiler.core.test.GraalCompilerTest;
! import org.graalvm.compiler.debug.DebugHandlersFactory;
! import org.graalvm.compiler.debug.DebugContext;
! import org.graalvm.compiler.debug.DebugContext.Scope;
import org.graalvm.compiler.graph.NodeClass;
import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder;
import org.graalvm.compiler.lir.FullInfopointOp;
import org.graalvm.compiler.lir.LIRFrameState;
import org.graalvm.compiler.lir.LIRInstruction;
*** 49,58 ****
--- 48,58 ----
import org.graalvm.compiler.nodeinfo.NodeInfo;
import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.spi.LIRLowerable;
import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool;
+ import org.junit.Test;
import jdk.vm.ci.code.BytecodeFrame;
import jdk.vm.ci.code.CodeCacheProvider;
import jdk.vm.ci.code.VirtualObject;
import jdk.vm.ci.code.site.InfopointReason;
*** 132,144 ****
public static void testMethod() {
}
private void test(TestSpec spec) {
ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
! StructuredGraph graph = parseForCompile(method);
TestNode test = graph.add(new TestNode(spec));
graph.addAfterFixed(graph.start(), test);
CompilationResult compResult = compile(method, graph);
CodeCacheProvider codeCache = getCodeCache();
--- 132,148 ----
public static void testMethod() {
}
private void test(TestSpec spec) {
+ test(getDebugContext(), spec);
+ }
+
+ private void test(DebugContext debug, TestSpec spec) {
ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
! StructuredGraph graph = parseForCompile(method, debug);
TestNode test = graph.add(new TestNode(spec));
graph.addAfterFixed(graph.start(), test);
CompilationResult compResult = compile(method, graph);
CodeCacheProvider codeCache = getCodeCache();
*** 264,279 ****
}
@SuppressWarnings("try")
@Test(expected = Error.class)
public void testUnknownJavaValue() {
! try (DebugConfigScope s = Debug.setConfig(Debug.silentConfig())) {
/*
* Expected: either AssertionError or GraalError, depending on whether the unit test run
* is with assertions enabled or disabled.
*/
! test((tool, state, safepoint) -> {
LIRFrameState newState = modifyTopFrame(state, new JavaValue[]{new UnknownJavaValue()}, new JavaKind[]{JavaKind.Int}, 1, 0, 0);
safepoint.accept(newState);
});
}
}
--- 268,284 ----
}
@SuppressWarnings("try")
@Test(expected = Error.class)
public void testUnknownJavaValue() {
! DebugContext debug = DebugContext.create(getInitialOptions(), DebugHandlersFactory.LOADER);
! try (Scope s = debug.disable()) {
/*
* Expected: either AssertionError or GraalError, depending on whether the unit test run
* is with assertions enabled or disabled.
*/
! test(debug, (tool, state, safepoint) -> {
LIRFrameState newState = modifyTopFrame(state, new JavaValue[]{new UnknownJavaValue()}, new JavaKind[]{JavaKind.Int}, 1, 0, 0);
safepoint.accept(newState);
});
}
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File