Examples of BytecodeInstruction


Examples of org.adoptopenjdk.jitwatch.model.bytecode.BytecodeInstruction

      BytecodeLabel bcLabel = (BytecodeLabel) viewerBytecode.getLabelAtIndex(index);

      if (bcLabel != null)
      {
        BytecodeInstruction instruction = bcLabel.getInstruction();

        int bytecodeOffset = instruction.getOffset();

        int sourceHighlight = -1;
        int assemblyHighlight = viewerAssembly.getIndexForBytecodeOffset(metaClass.getFullyQualifiedName(), bytecodeOffset);

        if (classBytecode != null)
View Full Code Here

Examples of org.adoptopenjdk.jitwatch.model.bytecode.BytecodeInstruction

    return result;
  }

  private static BytecodeInstruction getInstructionAtIndex(List<BytecodeInstruction> instructions, int index)
  {
    BytecodeInstruction found = null;

    for (BytecodeInstruction instruction : instructions)
    {
      if (instruction.getOffset() == index)
      {
View Full Code Here

Examples of org.adoptopenjdk.jitwatch.model.bytecode.BytecodeInstruction

    {
      isC2 = true;
    }

    boolean inMethod = true;
    BytecodeInstruction currentInstruction = null;

    for (Tag child : children)
    {
      String name = child.getName();
      Map<String, String> tagAttrs = child.getAttrs();

      switch (name)
      {
      case TAG_BC:
      {
        String bciAttr = tagAttrs.get(ATTR_BCI);
        String codeAttr = tagAttrs.get(ATTR_CODE);

        currentBytecode = Integer.parseInt(bciAttr);
        int code = Integer.parseInt(codeAttr);
        callAttrs.clear();

        // we found a LogCompilation bc tag
        // e.g. "<bc code='182' bci='2'/>"
        // Now check in the current class bytecode
        // that the instruction at offset bci
        // has the same opcode as attribute code
        // if not then this is probably a TieredCompilation
        // context change. (TieredCompilation does not use
        // nested parse tags so have to use this heuristic
        // to check if we are still in the same method.

        if (DEBUG_LOGGING_BYTECODE)
        {
          logger.debug("BC Tag {} {}", currentBytecode, code);
        }

        currentInstruction = getInstructionAtIndex(instructions, currentBytecode);

        if (DEBUG_LOGGING_BYTECODE)
        {
          logger.debug("Instruction at {} is {}", currentBytecode, currentInstruction);
        }

        inMethod = false;

        if (currentInstruction != null)
        {
          int opcodeValue = currentInstruction.getOpcode().getValue();

          if (opcodeValue == code)
          {
            inMethod = true;
          }
        }
      }
        break;
      case TAG_CALL:
      {
        callAttrs.clear();
        callAttrs.putAll(tagAttrs);
      }
        break;
      case TAG_METHOD:
      {
        methodAttrs.clear();
        methodAttrs.putAll(tagAttrs);

        String nameAttr = methodAttrs.get(ATTR_NAME);

        inMethod = false;

        if (nameAttr != null && currentInstruction != null && currentInstruction.hasComment())
        {
          String comment = currentInstruction.getComment();

          inMethod = comment.contains(nameAttr);
        }
      }
        break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.