Exemple #1
0
 @Override
 public void visit(IMetaMember metaMember) {
   if (metaMember == null) {
     return;
   }
   if (!metaMember.isCompiled()) {
     return;
   }
   try {
     String callerName = metaMember.toString();
     InlineJournalVisitor inlineJournalVisitor =
         new InlineJournalVisitor(failures, model, callerName);
     JournalUtil.visitParseTagsOfLastTask(metaMember.getJournal(), inlineJournalVisitor);
   } catch (LogParseException e) {
     logger.error("Error building inlining stats", e);
   }
 }
Exemple #2
0
    private void processParseTag(Tag parseTag, IParseDictionary parseDictionary) {
      String methodID = null;

      for (Tag child : parseTag.getChildren()) {
        String tagName = child.getName();

        Map<String, String> tagAttrs = child.getAttributes();

        switch (tagName) {
          case TAG_METHOD:
            {
              methodID = tagAttrs.get(ATTR_ID);
              break;
            }

          case TAG_CALL:
            {
              methodID = tagAttrs.get(ATTR_METHOD);
              break;
            }

          case TAG_INLINE_FAIL:
            {
              String reason = tagAttrs.get(ATTR_REASON);
              Map<String, InlineFailureInfo> inlineFailureInfos = failures.get(reason);

              if (inlineFailureInfos == null) {
                inlineFailureInfos = new HashMap<>();
                failures.put(reason, inlineFailureInfos);
              }

              IMetaMember metaMember = ParseUtil.lookupMember(methodID, parseDictionary, model);

              if (metaMember == null) {
                logger.warn("Cannot find name of methodId: ", methodID);
              } else {
                String memberName = metaMember.toString();
                InlineFailureInfo inlineFailureInfo = inlineFailureInfos.get(memberName);
                if (inlineFailureInfo == null) {
                  Tag methodTag = parseDictionary.getMethod(methodID);
                  int byteCodeSize = Integer.parseInt(methodTag.getAttribute(ATTR_BYTES));
                  inlineFailureInfo = new InlineFailureInfo(memberName, byteCodeSize);
                  inlineFailureInfos.put(memberName, inlineFailureInfo);
                }
                inlineFailureInfo.addCaller(callerName);
                inlineFailureInfo.incFailureCount();
              }
              methodID = null;

              break;
            }

          case TAG_INLINE_SUCCESS:
            {
              break;
            }

          case TAG_PARSE:
            {
              processParseTag(child, parseDictionary);
              break;
            }

          case TAG_PHASE:
            {
              String phaseName = tagAttrs.get(ATTR_NAME);

              if (S_PARSE_HIR.equals(phaseName)) {
                processParseTag(child, parseDictionary);
              } else {
                logger.warn("Don't know how to handle phase {}", phaseName);
              }

              break;
            }

          default:
            handleOther(child);
            break;
        }
      }
    }