• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /openjdk10/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/

Lines Matching defs:Result

52     static class Result {
59 Result(MatchResultCode result, Node node, MatchPattern matcher) {
72 static final Result OK = new Result(MatchResultCode.OK, null, null);
73 private static final Result CACHED_WRONG_CLASS = new Result(MatchResultCode.WRONG_CLASS, null, null);
74 private static final Result CACHED_NAMED_VALUE_MISMATCH = new Result(MatchResultCode.NAMED_VALUE_MISMATCH, null, null);
75 private static final Result CACHED_TOO_MANY_USERS = new Result(MatchResultCode.TOO_MANY_USERS, null, null);
76 private static final Result CACHED_NOT_IN_BLOCK = new Result(MatchResultCode.NOT_IN_BLOCK, null, null);
77 private static final Result CACHED_NOT_SAFE = new Result(MatchResultCode.NOT_SAFE, null, null);
78 private static final Result CACHED_ALREADY_USED = new Result(MatchResultCode.ALREADY_USED, null, null);
80 static Result wrongClass(Node node, MatchPattern matcher) {
82 return node.getDebug().isLogEnabled() ? new Result(MatchResultCode.WRONG_CLASS, node, matcher) : CACHED_WRONG_CLASS;
85 static Result namedValueMismatch(Node node, MatchPattern matcher) {
87 return node.getDebug().isLogEnabled() ? new Result(MatchResultCode.NAMED_VALUE_MISMATCH, node, matcher) : CACHED_NAMED_VALUE_MISMATCH;
90 static Result tooManyUsers(Node node, MatchPattern matcher) {
92 return node.getDebug().isLogEnabled() ? new Result(MatchResultCode.TOO_MANY_USERS, node, matcher) : CACHED_TOO_MANY_USERS;
95 static Result notInBlock(Node node, MatchPattern matcher) {
97 return node.getDebug().isLogEnabled() ? new Result(MatchResultCode.NOT_IN_BLOCK, node, matcher) : CACHED_NOT_IN_BLOCK;
100 static Result notSafe(Node node, MatchPattern matcher) {
102 return node.getDebug().isLogEnabled() ? new Result(MatchResultCode.NOT_SAFE, node, matcher) : CACHED_NOT_SAFE;
105 static Result alreadyUsed(Node node, MatchPattern matcher) {
107 return node.getDebug().isLogEnabled() ? new Result(MatchResultCode.ALREADY_USED, node, matcher) : CACHED_ALREADY_USED;
189 private Result matchType(Node node) {
191 return Result.wrongClass(node, this);
193 return Result.OK;
201 * @return Result.OK is the pattern can be safely matched.
203 Result matchUsage(Node node, MatchContext context) {
204 Result result = matchUsage(node, context, true);
205 if (result == Result.OK) {
211 private Result matchUsage(Node node, MatchContext context, boolean atRoot) {
212 Result result = matchType(node);
213 if (result != Result.OK) {
218 if (result != Result.OK) {
229 if (result != Result.OK) {
243 * @return Result.OK if the shape of the pattern matches.
245 public Result matchShape(Node node, MatchStatement statement) {
249 private Result matchShape(Node node, MatchStatement statement, boolean atRoot) {
250 Result result = matchType(node);
251 if (result != Result.OK) {
257 return Result.tooManyUsers(node, statement.getPattern());
263 if (result != Result.OK) {