use of org.graalvm.compiler.core.common.spi.ForeignCallLinkage in project graal by oracle.
the class AArch64HotSpotNodeLIRBuilder 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 outgoingCc = linkage.getOutgoingCallingConvention();
assert outgoingCc.getArgumentCount() == 2;
RegisterValue exceptionFixed = (RegisterValue) outgoingCc.getArgument(0);
RegisterValue exceptionPcFixed = (RegisterValue) outgoingCc.getArgument(1);
gen.emitMove(exceptionFixed, operand(exception));
gen.emitMove(exceptionPcFixed, operand(exceptionPc));
Register thread = getGen().getProviders().getRegisters().getThreadRegister();
AArch64HotSpotJumpToExceptionHandlerInCallerOp op = new AArch64HotSpotJumpToExceptionHandlerInCallerOp(handler, exceptionFixed, exceptionPcFixed, getGen().config.threadIsMethodHandleReturnOffset, thread, getGen().config);
append(op);
}
use of org.graalvm.compiler.core.common.spi.ForeignCallLinkage in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitUnwind.
@Override
public void emitUnwind(Value exception) {
ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER);
CallingConvention outgoingCc = linkage.getOutgoingCallingConvention();
assert outgoingCc.getArgumentCount() == 2;
RegisterValue exceptionParameter = (RegisterValue) outgoingCc.getArgument(0);
emitMove(exceptionParameter, exception);
append(new AMD64HotSpotUnwindOp(exceptionParameter));
}
use of org.graalvm.compiler.core.common.spi.ForeignCallLinkage in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitConstantRetrieval.
private Value emitConstantRetrieval(ForeignCallDescriptor foreignCall, Object[] notes, Constant[] constants, AllocatableValue[] constantDescriptions, LIRFrameState frameState) {
ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(foreignCall);
append(new AMD64HotSpotConstantRetrievalOp(constants, constantDescriptions, frameState, linkage, notes));
AllocatableValue result = linkage.getOutgoingCallingConvention().getReturn();
return emitMove(result);
}
use of org.graalvm.compiler.core.common.spi.ForeignCallLinkage in project graal by oracle.
the class AMD64HotSpotNodeLIRBuilder 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 outgoingCc = linkage.getOutgoingCallingConvention();
assert outgoingCc.getArgumentCount() == 2;
RegisterValue exceptionFixed = (RegisterValue) outgoingCc.getArgument(0);
RegisterValue exceptionPcFixed = (RegisterValue) outgoingCc.getArgument(1);
gen.emitMove(exceptionFixed, operand(exception));
gen.emitMove(exceptionPcFixed, operand(exceptionPc));
Register thread = getGen().getProviders().getRegisters().getThreadRegister();
AMD64HotSpotJumpToExceptionHandlerInCallerOp op = new AMD64HotSpotJumpToExceptionHandlerInCallerOp(handler, exceptionFixed, exceptionPcFixed, getGen().config.threadIsMethodHandleReturnOffset, thread);
append(op);
}
use of org.graalvm.compiler.core.common.spi.ForeignCallLinkage in project graal by oracle.
the class RegisterFinalizerNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
// Note that an unconditional call to the runtime routine is made without
// checking that the object actually has a finalizer. This requires the
// runtime routine to do the check.
ForeignCallLinkage linkage = gen.getLIRGeneratorTool().getForeignCalls().lookupForeignCall(REGISTER_FINALIZER);
gen.getLIRGeneratorTool().emitForeignCall(linkage, gen.state(this), gen.operand(getValue()));
}
Aggregations