Package org.adoptopenjdk.jitwatch.model

Examples of org.adoptopenjdk.jitwatch.model.Tag


  {
    TagProcessor tp = new TagProcessor();

    int count = 0;

    Tag tag = null;

    for (String line : lines)
    {   
      line = line.trim();
      line = line.replace(S_ENTITY_LT, S_OPEN_ANGLE);
View Full Code Here


    return currentCompiler;
  }

  public Tag processLine(String line)
  {
    Tag result = null;

    if (line != null)
    {
      if (line.length() > 3 && line.charAt(0) == C_OPEN_ANGLE)
      {
View Full Code Here

    return result;
  }

  private Tag handleTag(String line)
  {
    Tag result = null;

    // closing tag
    if (line.charAt(1) == C_SLASH)
    {     
      String closeName = line.substring(2, line.length() - 1);
View Full Code Here

    return result;
  }

  private Tag processValidLine(String line, int indexEndName, boolean selfClosing)
  {
    Tag result = null;

    String name = line.substring(1, indexEndName);

    String remainder = line.substring(indexEndName);

    Map<String, String> attrs = StringUtil.getLineAttributes(remainder);

    Tag t;

    if (JITWatchConstants.TAG_TASK.equals(name))
    {
      t = new Task(name, attrs, selfClosing, currentCompiler);
    }
    else
    {
      t = new Tag(name, attrs, selfClosing);
    }

    if (currentTag == null)
    {
      // new tag at top level
View Full Code Here

    TagProcessor tp = new TagProcessor();

    int count = 0;

    Tag tag = null;

    for (String line : lines)
    {
      tag = tp.processLine(line);
      if (count++ < lines.length - 1)
View Full Code Here

    TagProcessor tp = new TagProcessor();

    int count = 0;

    Tag tag = null;

    for (String line : lines)
    {
      tag = tp.processLine(line);
      if (count++ < lines.length - 1)
View Full Code Here

            Then no tags should be returned
    */
    @Test
    public void givenALineWithTwoDifferentOpenCloseTags_WhenTheTagProcessorActionsIt_ThenNoTagsAreReturned() {
        // Given
        Tag expectedParseResult = null;
        String aLineWithOpeningTag = "<loop idx='1012' inner_loop='1' >";
        String aLineWithClosingTag = "</line>";

        // When
        TagProcessor tagProcessor = new TagProcessor();
        tagProcessor.processLine(aLineWithOpeningTag);
        Tag actualTag = tagProcessor.processLine(aLineWithClosingTag);

        // Then
        assertThat("No tags should have been returned.",
                actualTag,
                is(equalTo(expectedParseResult)));
View Full Code Here

            Then no tags should be returned
    */
    @Test
    public void givenALineWithAnOpenTagWithNoCloseAngleBracket_WhenTheTagProcessorActionsIt_ThenNoTagsAreReturned() {
        // Given
        Tag expectedParseResult = null;
        String aLineWithOpeningTagWithoutClosingAngleBracket = "<loop";

        // When
        TagProcessor tagProcessor = new TagProcessor();
        Tag actualTag = tagProcessor.processLine(aLineWithOpeningTagWithoutClosingAngleBracket);

        // Then
        assertThat("No tags should have been returned.",
                actualTag,
                is(equalTo(expectedParseResult)));
View Full Code Here

      if (lastTaskTag != null)
      {
        IParseDictionary parseDictionary = lastTaskTag.getParseDictionary();

        Tag parsePhase = JournalUtil.getParsePhase(journal);

        if (parsePhase != null)
        {
          List<Tag> parseTags = parsePhase.getNamedChildren(TAG_PARSE);

          for (Tag parseTag : parseTags)
          {
            String currentMethod = null;
            String holder = null;

            List<Tag> allChildren = parseTag.getChildren();

            for (Tag childTag : allChildren)
            {
              String tagName = childTag.getName();
              Map<String, String> attrs = childTag.getAttrs();

              switch (tagName)
              {
              case TAG_METHOD:
              {
                currentMethod = attrs.get(ATTR_NAME);
                holder = attrs.get(ATTR_HOLDER);
              }
                break;

              // changes member context
              case TAG_CALL:
              {
                String methodID = attrs.get(ATTR_METHOD);

                Tag methodTag = parseDictionary.getMethod(methodID);
                currentMethod = methodTag.getAttribute(ATTR_NAME);
                holder = methodTag.getAttribute(ATTR_HOLDER);
              }
                break;

              case TAG_INTRINSIC:
              {
                if (holder != null && currentMethod != null)
                {
                  Tag klassTag = parseDictionary.getKlass(holder);

                  String intrinsic = childTag.getAttribute(ATTR_ID);

                  if (klassTag != null)
                  {
                    String fqName = klassTag.getAttribute(ATTR_NAME).replace(C_SLASH, C_DOT) + C_DOT
                        + currentMethod;

                    result.put(fqName, intrinsic);
                  }
                }
View Full Code Here

  {
    if (mm.isCompiled())
    {
      Journal journal = mm.getJournal();

      Tag parsePhase = JournalUtil.getParsePhase(journal);

      if (parsePhase != null)
      {
        List<Tag> parseTags = parsePhase.getNamedChildren(TAG_PARSE);

        for (Tag parseTag : parseTags)
        {
          processParseTag(parseTag);
        }
View Full Code Here

TOP

Related Classes of org.adoptopenjdk.jitwatch.model.Tag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.