use of org.graalvm.compiler.nodes.extended.ForeignCallWithExceptionNode in project graal by oracle.
the class NodeLIRBuilder method emitForeignCall.
@Override
public void emitForeignCall(ForeignCall x) {
ForeignCallLinkage linkage = gen.getForeignCalls().lookupForeignCall(x.getDescriptor());
LabelRef exceptionEdge = null;
if (x instanceof ForeignCallWithExceptionNode) {
exceptionEdge = getLIRBlock(((ForeignCallWithExceptionNode) x).exceptionEdge());
}
LIRFrameState callState = stateWithExceptionEdge(x, exceptionEdge);
Value[] args = x.operands(this);
Value result = gen.emitForeignCall(linkage, callState, args);
if (result != null) {
setResult(x.asNode(), result);
}
if (x instanceof ForeignCallWithExceptionNode) {
gen.emitJump(getLIRBlock(((ForeignCallWithExceptionNode) x).next()));
}
}
use of org.graalvm.compiler.nodes.extended.ForeignCallWithExceptionNode in project graal by oracle.
the class NodeLLVMBuilder method emitForeignCall.
@Override
public void emitForeignCall(ForeignCall i) {
ForeignCallLinkage linkage = gen.getForeignCalls().lookupForeignCall(i.getDescriptor());
LIRFrameState state = state(i);
Value[] args = i.operands(this);
Value result = null;
if (i instanceof ForeignCallNode) {
result = gen.emitForeignCall(linkage, state, args);
} else if (i instanceof ForeignCallWithExceptionNode) {
ForeignCallWithExceptionNode foreignCallWithExceptionNode = (ForeignCallWithExceptionNode) i;
LLVMBasicBlockRef successor = gen.getBlock(foreignCallWithExceptionNode.next());
LLVMBasicBlockRef handler = gen.getBlock(foreignCallWithExceptionNode.exceptionEdge());
result = gen.emitForeignCall(linkage, state, successor, handler, args);
} else {
throw shouldNotReachHere();
}
if (result != null) {
setResult(i.asNode(), result);
}
}
Aggregations