src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java

Print this page

        

*** 20,51 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.core.match; ! import static org.graalvm.compiler.debug.GraalDebugConfig.Options.LogVerbose; import java.util.List; - import jdk.vm.ci.meta.Value; - import org.graalvm.compiler.core.gen.NodeLIRBuilder; import org.graalvm.compiler.core.match.MatchPattern.MatchResultCode; import org.graalvm.compiler.core.match.MatchPattern.Result; ! import org.graalvm.compiler.debug.Debug; ! import org.graalvm.compiler.debug.DebugCounter; import org.graalvm.compiler.graph.GraalGraphError; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.nodeinfo.Verbosity; /** * A named {@link MatchPattern} along with a {@link MatchGenerator} that can be evaluated to replace * one or more {@link Node}s with a single {@link Value}. */ public class MatchStatement { ! private static final DebugCounter MatchStatementSuccess = Debug.counter("MatchStatementSuccess"); /** * A printable name for this statement. Usually it's just the name of the method doing the * emission. */ --- 20,51 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.core.match; ! 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; ! import org.graalvm.compiler.debug.CounterKey; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.graph.GraalGraphError; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.nodeinfo.Verbosity; + import jdk.vm.ci.meta.Value; + /** * A named {@link MatchPattern} along with a {@link MatchGenerator} that can be evaluated to replace * one or more {@link Node}s with a single {@link Value}. */ public class MatchStatement { ! private static final CounterKey MatchStatementSuccess = DebugContext.counter("MatchStatementSuccess"); /** * A printable name for this statement. Usually it's just the name of the method doing the * emission. */
*** 81,90 **** --- 81,91 ---- * @param nodes the nodes in the current block * @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<Node> nodes) { + DebugContext debug = node.getDebug(); assert index == nodes.indexOf(node); // Check that the basic shape matches Result result = pattern.matchShape(node, this); if (result != Result.OK) { return false;
*** 95,117 **** if (result == Result.OK) { // Invoke the generator method and set the result if it's non null. ComplexMatchResult value = generatorMethod.match(builder.getNodeMatchRules(), buildArgList(context)); if (value != null) { context.setResult(value); ! MatchStatementSuccess.increment(); ! Debug.counter("MatchStatement[%s]", getName()).increment(); return true; } // The pattern matched but some other code generation constraint disallowed code // generation for the pattern. if (LogVerbose.getValue(node.getOptions())) { ! Debug.log("while matching %s|%s %s %s returned null", context.getRoot().toString(Verbosity.Id), context.getRoot().getClass().getSimpleName(), getName(), generatorMethod.getName()); ! Debug.log("with nodes %s", formatMatch(node)); } } else { if (LogVerbose.getValue(node.getOptions()) && result.code != MatchResultCode.WRONG_CLASS) { ! Debug.log("while matching %s|%s %s %s", context.getRoot().toString(Verbosity.Id), context.getRoot().getClass().getSimpleName(), getName(), result); } } return false; } --- 96,118 ---- if (result == Result.OK) { // Invoke the generator method and set the result if it's non null. ComplexMatchResult value = generatorMethod.match(builder.getNodeMatchRules(), buildArgList(context)); if (value != null) { context.setResult(value); ! MatchStatementSuccess.increment(debug); ! DebugContext.counter("MatchStatement[%s]", getName()).increment(debug); return true; } // The pattern matched but some other code generation constraint disallowed code // generation for the pattern. if (LogVerbose.getValue(node.getOptions())) { ! debug.log("while matching %s|%s %s %s returned null", context.getRoot().toString(Verbosity.Id), context.getRoot().getClass().getSimpleName(), getName(), generatorMethod.getName()); ! debug.log("with nodes %s", formatMatch(node)); } } else { if (LogVerbose.getValue(node.getOptions()) && result.code != MatchResultCode.WRONG_CLASS) { ! debug.log("while matching %s|%s %s %s", context.getRoot().toString(Verbosity.Id), context.getRoot().getClass().getSimpleName(), getName(), result); } } return false; }
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File