--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java 2019-03-28 07:36:57.256546349 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java 2019-03-28 07:36:56.872543783 +0100 @@ -26,8 +26,6 @@ import static org.graalvm.compiler.debug.DebugOptions.LogVerbose; -import java.util.List; - import org.graalvm.compiler.core.gen.NodeLIRBuilder; import org.graalvm.compiler.core.match.MatchPattern.MatchResultCode; import org.graalvm.compiler.core.match.MatchPattern.Result; @@ -38,6 +36,8 @@ import org.graalvm.compiler.nodeinfo.Verbosity; import jdk.vm.ci.meta.Value; +import org.graalvm.compiler.nodes.StructuredGraph; +import org.graalvm.compiler.nodes.cfg.Block; /** * A named {@link MatchPattern} along with a {@link MatchGenerator} that can be evaluated to replace @@ -80,20 +80,21 @@ * * @param builder the current builder instance. * @param node the node to be matched - * @param nodes the nodes in the current block + * @param block the current block + * @param schedule the schedule that's being used * @return true if the statement matched something and set a {@link ComplexMatchResult} to be * evaluated by the NodeLIRBuilder. */ - public boolean generate(NodeLIRBuilder builder, int index, Node node, List nodes) { + public boolean generate(NodeLIRBuilder builder, int index, Node node, Block block, StructuredGraph.ScheduleResult schedule) { DebugContext debug = node.getDebug(); - assert index == nodes.indexOf(node); + assert index == schedule.getBlockToNodesMap().get(block).indexOf(node); // Check that the basic shape matches Result result = pattern.matchShape(node, this); if (result != Result.OK) { return false; } // Now ensure that the other safety constraints are matched. - MatchContext context = new MatchContext(builder, this, index, node, nodes); + MatchContext context = new MatchContext(builder, this, index, node, block, schedule); result = pattern.matchUsage(node, context); if (result == Result.OK) { // Invoke the generator method and set the result if it's non null.