Search in sources :

Example 21 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class JVMCIInfopointErrorTest method modifyTopFrame.

private static LIRFrameState modifyTopFrame(LIRFrameState state, VirtualObject[] vobj, JavaValue[] values, JavaKind[] slotKinds, int locals, int stack, int locks) {
    BytecodeFrame top = state.topFrame;
    top = new BytecodeFrame(top.caller(), top.getMethod(), top.getBCI(), top.rethrowException, top.duringCall, values, slotKinds, locals, stack, locks);
    return new LIRFrameState(top, vobj, state.exceptionEdge);
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) BytecodeFrame(jdk.vm.ci.code.BytecodeFrame)

Example 22 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class JVMCIInfopointErrorTest method testUnexpectedScopeValuesLength.

@Test(expected = JVMCIError.class)
public void testUnexpectedScopeValuesLength() {
    test((tool, state, safepoint) -> {
        LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { JavaConstant.FALSE }, new JavaKind[0], 0, 0, 0);
        safepoint.accept(newState);
    });
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest) Test(org.junit.Test)

Example 23 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class JVMCIInfopointErrorTest method testUnexpectedObject.

@Test(expected = JVMCIError.class)
public void testUnexpectedObject() {
    JavaValue wrapped = getSnippetReflection().forObject(this);
    test((tool, state, safepoint) -> {
        LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { wrapped }, new JavaKind[] { JavaKind.Int }, 1, 0, 0);
        safepoint.accept(newState);
    });
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) JavaValue(jdk.vm.ci.meta.JavaValue) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest) Test(org.junit.Test)

Example 24 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class JVMCIInfopointErrorTest method testWrongMonitorType.

@Test(expected = JVMCIError.class)
public void testWrongMonitorType() {
    test((tool, state, safepoint) -> {
        LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { JavaConstant.INT_0 }, new JavaKind[] {}, 0, 0, 1);
        safepoint.accept(newState);
    });
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest) Test(org.junit.Test)

Example 25 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class JVMCIInfopointErrorTest method testUnsupportedConstantType.

@Test(expected = JVMCIError.class)
public void testUnsupportedConstantType() {
    test((tool, state, safepoint) -> {
        LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { JavaConstant.forShort((short) 0) }, new JavaKind[] { JavaKind.Short }, 1, 0, 0);
        safepoint.accept(newState);
    });
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest) Test(org.junit.Test)

Aggregations

LIRFrameState (org.graalvm.compiler.lir.LIRFrameState)33 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)15 Test (org.junit.Test)15 Register (jdk.vm.ci.code.Register)7 Value (jdk.vm.ci.meta.Value)7 VirtualObject (jdk.vm.ci.code.VirtualObject)5 Variable (org.graalvm.compiler.lir.Variable)5 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)4 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 DebugContext (org.graalvm.compiler.debug.DebugContext)3 HotSpotForeignCallLinkage (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage)3 HotSpotLIRGenerator (org.graalvm.compiler.hotspot.HotSpotLIRGenerator)3 SaveRegistersOp (org.graalvm.compiler.lir.StandardOp.SaveRegistersOp)3 BytecodeFrame (jdk.vm.ci.code.BytecodeFrame)2 CallingConvention (jdk.vm.ci.code.CallingConvention)2 HotSpotMetaspaceConstant (jdk.vm.ci.hotspot.HotSpotMetaspaceConstant)2 JavaValue (jdk.vm.ci.meta.JavaValue)2 HotSpotLIRGenerationResult (org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult)2 HotSpotRegistersProvider (org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider)2 Stub (org.graalvm.compiler.hotspot.stubs.Stub)2