Search in sources :

Example 1 with FallbackInvokeWithExceptionNode

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);
            }
        }
    }
}
Also used : FallbackInvokeWithExceptionNode(org.graalvm.compiler.replacements.nodes.FallbackInvokeWithExceptionNode) MacroWithExceptionNode(org.graalvm.compiler.replacements.nodes.MacroWithExceptionNode) MacroNode(org.graalvm.compiler.replacements.nodes.MacroNode) Node(org.graalvm.compiler.graph.Node) FallbackInvokeWithExceptionNode(org.graalvm.compiler.replacements.nodes.FallbackInvokeWithExceptionNode) Lowerable(org.graalvm.compiler.nodes.spi.Lowerable)

Aggregations

Node (org.graalvm.compiler.graph.Node)1 Lowerable (org.graalvm.compiler.nodes.spi.Lowerable)1 FallbackInvokeWithExceptionNode (org.graalvm.compiler.replacements.nodes.FallbackInvokeWithExceptionNode)1 MacroNode (org.graalvm.compiler.replacements.nodes.MacroNode)1 MacroWithExceptionNode (org.graalvm.compiler.replacements.nodes.MacroWithExceptionNode)1