use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitForeignCall.
@Override
public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
HotSpotForeignCallLinkage hotspotLinkage = (HotSpotForeignCallLinkage) linkage;
Variable result;
LIRFrameState debugInfo = null;
if (hotspotLinkage.needsDebugInfo()) {
debugInfo = state;
assert debugInfo != null || getStub() != null;
}
if (linkage.destroysRegisters() || hotspotLinkage.needsJavaFrameAnchor()) {
HotSpotRegistersProvider registers = getProviders().getRegisters();
Register thread = registers.getThreadRegister();
Value threadTemp = newVariable(LIRKind.value(SPARCKind.XWORD));
Register stackPointer = registers.getStackPointerRegister();
Variable spScratch = newVariable(LIRKind.value(target().arch.getWordKind()));
append(new SPARCHotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread, stackPointer, threadTemp, spScratch));
result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
append(new SPARCHotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadJavaFrameAnchorFlagsOffset(), thread, threadTemp));
} else {
result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
}
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitUncompress.
@Override
public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
LIRKind inputKind = pointer.getValueKind(LIRKind.class);
assert inputKind.getPlatformKind() == WORD;
if (inputKind.isReference(0)) {
// oop
Variable result = newVariable(LIRKind.reference(XWORD));
append(new SPARCHotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
return result;
} else {
// metaspace pointer
Variable result = newVariable(LIRKind.value(XWORD));
AllocatableValue base = Value.ILLEGAL;
if (encoding.hasBase()) {
base = emitLoadConstant(LIRKind.value(XWORD), JavaConstant.forLong(encoding.getBase()));
}
append(new SPARCHotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
return result;
}
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class SPARCHotSpotNodeLIRBuilder method emitJumpToExceptionHandlerInCaller.
@Override
public void emitJumpToExceptionHandlerInCaller(ValueNode handlerInCallerPc, ValueNode exception, ValueNode exceptionPc) {
Variable handler = gen.load(operand(handlerInCallerPc));
ForeignCallLinkage linkage = gen.getForeignCalls().lookupForeignCall(EXCEPTION_HANDLER_IN_CALLER);
CallingConvention linkageCc = linkage.getOutgoingCallingConvention();
assert linkageCc.getArgumentCount() == 2;
RegisterValue exceptionFixed = (RegisterValue) linkageCc.getArgument(0);
RegisterValue exceptionPcFixed = (RegisterValue) linkageCc.getArgument(1);
gen.emitMove(exceptionFixed, operand(exception));
gen.emitMove(exceptionPcFixed, operand(exceptionPc));
Register thread = getGen().getProviders().getRegisters().getThreadRegister();
SPARCHotSpotJumpToExceptionHandlerInCallerOp op = new SPARCHotSpotJumpToExceptionHandlerInCallerOp(handler, exceptionFixed, exceptionPcFixed, getGen().config.threadIsMethodHandleReturnOffset, thread);
append(op);
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitLoadMetaspaceAddress.
@Override
public Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) constant;
LIRKind kind = metaspaceConstant.isCompressed() ? getLIRKindTool().getNarrowPointerKind() : getLIRKindTool().getWordKind();
Variable result = newVariable(kind);
append(new AMD64HotSpotLoadAddressOp(result, constant, action));
return result;
}
use of org.graalvm.compiler.lir.Variable in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitLoadConfigValue.
@Override
public Value emitLoadConfigValue(int markId, LIRKind kind) {
Variable result = newVariable(kind);
append(new AMD64HotSpotLoadConfigValueOp(markId, result));
return result;
}
Aggregations