Class BytecodeInstruction

  • All Implemented Interfaces:
    BytecodeEntry

    public final class BytecodeInstruction
    extends Object
    implements BytecodeEntry
    Bytecode instruction.
    Since:
    0.1
    Suppressed Checkstyle violations:
    FileLengthCheck (2000 lines)
    • Constructor Detail

      • BytecodeInstruction

        public BytecodeInstruction​(int opcode,
                                   Object... args)
        Constructor.
        Parameters:
        opcode - Opcode.
        args - Arguments.
    • Method Detail

      • writeTo

        public void writeTo​(org.objectweb.asm.MethodVisitor visitor,
                            AsmLabels labels)
        Description copied from interface: BytecodeEntry
        Write instruction to the method visitor.
        Specified by:
        writeTo in interface BytecodeEntry
        Parameters:
        visitor - Method visitor.
        labels - Method labels.
      • directives

        public Iterable<org.xembly.Directive> directives​(boolean counting)
        Description copied from interface: BytecodeEntry
        Convert entry to directives.
        Specified by:
        directives in interface BytecodeEntry
        Parameters:
        counting - Do we need to add numbers to entry names?
        Returns:
        Directives.
      • isLabel

        public boolean isLabel()
        Description copied from interface: BytecodeEntry
        Is this instruction a label?
        Specified by:
        isLabel in interface BytecodeEntry
        Returns:
        True if it is.
      • isOpcode

        public boolean isOpcode()
        Description copied from interface: BytecodeEntry
        Is this instruction a regular opcode?
        Specified by:
        isOpcode in interface BytecodeEntry
        Returns:
        True if it is.
      • impact

        public int impact()
        Impact of each instruction on the stack.
        Specified by:
        impact in interface BytecodeEntry
        Returns:
        Stack impact.
        Suppressed Checkstyle violations:
        CyclomaticComplexityCheck (350 lines), MethodLengthCheck (350 lines), JavaNCSSCheck (350 lines), AvoidNestedBlocksCheck (350 lines)
      • isJump

        public boolean isJump()
        Is this instruction a jump instruction? Is it a goto or jsr?
        Specified by:
        isJump in interface BytecodeEntry
        Returns:
        True if it is.
      • isIf

        public boolean isIf()
        Is this instruction a conditional branch instruction?
        Specified by:
        isIf in interface BytecodeEntry
        Returns:
        True if it is.
        Suppressed Checkstyle violations:
        CyclomaticComplexityCheck (100 lines)
      • isSwitch

        public boolean isSwitch()
        Is this instruction a switch instruction?
        Specified by:
        isSwitch in interface BytecodeEntry
        Returns:
        True if it is.
      • isReturn

        public boolean isReturn()
        Is this instruction a return instruction?
        Specified by:
        isReturn in interface BytecodeEntry
        Returns:
        True if it is.
      • jumps

        public List<BytecodeLabel> jumps()
        Jump to a label. Where to jump.
        Specified by:
        jumps in interface BytecodeEntry
        Returns:
        Jump label.
        Suppressed Checkstyle violations:
        CyclomaticComplexityCheck (100 lines)
      • isThrow

        public boolean isThrow()
        Description copied from interface: BytecodeEntry
        Is this instruction a throw statement?
        Specified by:
        isThrow in interface BytecodeEntry
        Returns:
        True if it is.