use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testUndefinedVirtualObject.
@Test(expected = JVMCIError.class)
public void testUndefinedVirtualObject() {
ResolvedJavaType obj = getMetaAccess().lookupJavaType(Object.class);
test((tool, state, safepoint) -> {
VirtualObject o0 = VirtualObject.get(obj, 0);
o0.setValues(new JavaValue[0], new JavaKind[0]);
VirtualObject o1 = VirtualObject.get(obj, 1);
o1.setValues(new JavaValue[0], new JavaKind[0]);
LIRFrameState newState = modifyTopFrame(state, new VirtualObject[] { o0 }, new JavaValue[] { o1 }, new JavaKind[] { JavaKind.Object }, 1, 0, 0);
safepoint.accept(newState);
});
}
use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testUnexpectedTypeInRegister.
@Test(expected = JVMCIError.class)
public void testUnexpectedTypeInRegister() {
test((tool, state, safepoint) -> {
Variable var = tool.newVariable(LIRKind.fromJavaKind(tool.target().arch, JavaKind.Int));
tool.append(new ValueDef(var));
LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { var }, new JavaKind[] { JavaKind.Illegal }, 1, 0, 0);
safepoint.accept(newState);
});
}
use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testUnexpectedIllegalValue.
@Test(expected = JVMCIError.class)
public void testUnexpectedIllegalValue() {
test((tool, state, safepoint) -> {
LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { Value.ILLEGAL }, new JavaKind[] { JavaKind.Int }, 1, 0, 0);
safepoint.accept(newState);
});
}
use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testUnknownJavaValue.
@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);
});
}
}
use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testInvalidVirtualObjectId.
@Test(expected = JVMCIError.class)
public void testInvalidVirtualObjectId() {
ResolvedJavaType obj = getMetaAccess().lookupJavaType(Object.class);
test((tool, state, safepoint) -> {
VirtualObject o = VirtualObject.get(obj, 5);
o.setValues(new JavaValue[0], new JavaKind[0]);
safepoint.accept(new LIRFrameState(state.topFrame, new VirtualObject[] { o }, state.exceptionEdge));
});
}
Aggregations