use of org.graalvm.compiler.nodes.PluginReplacementWithExceptionNode in project graal by oracle.
the class BytecodeParser method replacePluginWithException.
@Override
public void replacePluginWithException(GeneratedInvocationPlugin plugin, ResolvedJavaMethod targetMethod, ValueNode[] args, PluginReplacementWithExceptionNode.ReplacementWithExceptionFunction replacementFunction) {
assert replacementFunction != null;
JavaType returnType = maybeEagerlyResolve(targetMethod.getSignature().getReturnType(method.getDeclaringClass()), targetMethod.getDeclaringClass());
StampPair returnStamp = getReplacements().getGraphBuilderPlugins().getOverridingStamp(this, returnType, false);
if (returnStamp == null) {
returnStamp = StampFactory.forDeclaredType(getAssumptions(), returnType, false);
}
WithExceptionNode node = new PluginReplacementWithExceptionNode(returnStamp.getTrustedStamp(), args, replacementFunction, plugin.getClass().getSimpleName());
if (returnType.getJavaKind() == JavaKind.Void) {
add(node);
} else {
addPush(returnType.getJavaKind(), node);
}
}
Aggregations