use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testUnexpectedNull.
@Test(expected = JVMCIError.class)
public void testUnexpectedNull() {
test((tool, state, safepoint) -> {
LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { JavaConstant.NULL_POINTER }, 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 testWrongConstantType.
@Test(expected = JVMCIError.class)
public void testWrongConstantType() {
test((tool, state, safepoint) -> {
LIRFrameState newState = modifyTopFrame(state, new JavaValue[] { JavaConstant.INT_0 }, 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 testMissingIllegalAfterDouble.
@Test(expected = Error.class)
public void testMissingIllegalAfterDouble() {
/*
* 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[] { JavaConstant.DOUBLE_0, JavaConstant.INT_0 }, new JavaKind[] { JavaKind.Double, JavaKind.Int }, 2, 0, 0);
safepoint.accept(newState);
});
}
use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class JVMCIInfopointErrorTest method testUnexpectedVirtualObject.
@Test(expected = JVMCIError.class)
public void testUnexpectedVirtualObject() {
ResolvedJavaType obj = getMetaAccess().lookupJavaType(Object.class);
test((tool, state, safepoint) -> {
VirtualObject o = VirtualObject.get(obj, 0);
o.setValues(new JavaValue[0], new JavaKind[0]);
LIRFrameState newState = modifyTopFrame(state, new VirtualObject[] { o }, new JavaValue[] { o }, new JavaKind[] { JavaKind.Int }, 1, 0, 0);
safepoint.accept(newState);
});
}
use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.
the class HotSpotBackend method updateStub.
/**
* Updates a given stub with respect to the registers it destroys.
* <p>
* Any entry in {@code calleeSaveInfo} that {@linkplain SaveRegistersOp#supportsRemove()
* supports} pruning will have {@code destroyedRegisters}
* {@linkplain SaveRegistersOp#remove(EconomicSet) removed} as these registers are declared as
* temporaries in the stub's {@linkplain ForeignCallLinkage linkage} (and thus will be saved by
* the stub's caller).
*
* @param stub the stub to update
* @param destroyedRegisters the registers destroyed by the stub
* @param calleeSaveInfo a map from debug infos to the operations that provide their
* {@linkplain RegisterSaveLayout callee-save information}
* @param frameMap used to {@linkplain FrameMap#offsetForStackSlot(StackSlot) convert} a virtual
* slot to a frame slot index
*/
protected void updateStub(Stub stub, EconomicSet<Register> destroyedRegisters, EconomicMap<LIRFrameState, SaveRegistersOp> calleeSaveInfo, FrameMap frameMap) {
stub.initDestroyedCallerRegisters(destroyedRegisters);
MapCursor<LIRFrameState, SaveRegistersOp> cursor = calleeSaveInfo.getEntries();
while (cursor.advance()) {
SaveRegistersOp save = cursor.getValue();
if (save.supportsRemove()) {
save.remove(destroyedRegisters);
}
if (cursor.getKey() != LIRFrameState.NO_STATE) {
cursor.getKey().debugInfo().setCalleeSaveInfo(save.getMap(frameMap));
}
}
}
Aggregations