Search in sources :

Example 1 with LoweringTool

use of org.graalvm.compiler.nodes.spi.LoweringTool in project graal by oracle.

the class DefaultJavaLoweringProvider method lowerIndexOf.

private void lowerIndexOf(StringIndexOfNode n) {
    if (n.getArgument(3).isConstant()) {
        SnippetLowering lowering = new SnippetLowering() {

            @Override
            public void lower(SnippetLowerableMemoryNode node, LoweringTool tool) {
                if (tool.getLoweringStage() != LoweringTool.StandardLoweringStage.LOW_TIER) {
                    return;
                }
                indexOfSnippets.lower(node, tool);
            }
        };
        SnippetLowerableMemoryNode snippetLower = new SnippetLowerableMemoryNode(lowering, NamedLocationIdentity.getArrayLocation(JavaKind.Char), n.stamp(NodeView.DEFAULT), n.toArgumentArray());
        n.graph().add(snippetLower);
        n.graph().replaceFixedWithFixed(n, snippetLower);
    }
}
Also used : SnippetLowering(org.graalvm.compiler.replacements.SnippetLowerableMemoryNode.SnippetLowering) LoweringTool(org.graalvm.compiler.nodes.spi.LoweringTool)

Aggregations

LoweringTool (org.graalvm.compiler.nodes.spi.LoweringTool)1 SnippetLowering (org.graalvm.compiler.replacements.SnippetLowerableMemoryNode.SnippetLowering)1