use of org.graalvm.compiler.lir.Variable 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.Variable in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitLogicCompareAndSwap.
@Override
public Variable emitLogicCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
ValueKind<?> kind = newValue.getValueKind();
assert kind.equals(expectedValue.getValueKind());
SPARCKind memKind = (SPARCKind) kind.getPlatformKind();
Variable result = newVariable(newValue.getValueKind());
append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
return emitConditionalMove(memKind, expectedValue, result, Condition.EQ, true, trueValue, falseValue);
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitCompress.
@Override
public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
LIRKind inputKind = pointer.getValueKind(LIRKind.class);
assert inputKind.getPlatformKind() == XWORD : inputKind;
if (inputKind.isReference(0)) {
// oop
Variable result = newVariable(LIRKind.compressedReference(WORD));
append(new SPARCHotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
return result;
} else {
// metaspace pointer
Variable result = newVariable(LIRKind.value(WORD));
AllocatableValue base = Value.ILLEGAL;
if (encoding.hasBase()) {
base = emitLoadConstant(LIRKind.value(XWORD), JavaConstant.forLong(encoding.getBase()));
}
append(new SPARCHotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
return result;
}
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitValueCompareAndSwap.
@Override
public Variable emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
ValueKind<?> kind = newValue.getValueKind();
assert kind.equals(expectedValue.getValueKind());
Variable result = newVariable(newValue.getValueKind());
append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitMathAbs.
@Override
public Value emitMathAbs(Value inputValue) {
Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue));
SPARCKind kind = (SPARCKind) inputValue.getPlatformKind();
Opfs opf;
switch(kind) {
case SINGLE:
opf = Opfs.Fabss;
break;
case DOUBLE:
opf = Opfs.Fabsd;
break;
default:
throw GraalError.shouldNotReachHere("Input kind: " + kind);
}
getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result));
return result;
}
Aggregations