use of org.graalvm.compiler.replacements.nodes.FallbackInvokeWithExceptionNode in project graal by oracle.
the class SnippetSubstitutionNode method lower.
@Override
public void lower(LoweringTool tool) {
SnippetTemplate.Arguments args = new SnippetTemplate.Arguments(snippet, this.graph().getGuardsStage(), tool.getLoweringStage());
int arg = 0;
for (; arg < arguments.size(); arg++) {
args.add(snippet.getParameterName(arg), arguments.get(arg));
}
if (constantArguments != null) {
for (Object argument : constantArguments) {
args.addConst(snippet.getParameterName(arg), argument);
arg++;
}
}
SnippetTemplate template = templates.template(this, args);
UnmodifiableEconomicMap<Node, Node> duplicates = template.instantiate(tool.getMetaAccess(), this, SnippetTemplate.DEFAULT_REPLACER, args, true);
for (Node original : duplicates.getKeys()) {
if (original instanceof FallbackInvokeWithExceptionNode) {
Node replacement = duplicates.get(original);
if (replacement instanceof Lowerable) {
tool.getLowerer().lower(replacement, tool);
}
}
}
}
Aggregations