Class BytecodeInstruction

java.lang.Object
org.eolang.jeo.representation.bytecode.BytecodeInstruction
All Implemented Interfaces:
BytecodeEntry

public final class BytecodeInstruction extends Object implements BytecodeEntry
Bytecode instruction.
Since:
0.1
  • Constructor Summary

    Constructors
    Constructor
    Description
    BytecodeInstruction(int opcode, Object... args)
    Constructor.
    BytecodeInstruction(int opcode, List<Object> args)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Iterable<org.xembly.Directive>
    directives(boolean counting)
     
    int
    Impact of each instruction on the stack.
    boolean
    Is this instruction a jump instruction?
    boolean
    Is this instruction a conditional branch instruction?
    boolean
    Is this instruction a label?
    boolean
    Is this instruction a regular opcode?
    boolean
    Is this instruction a return instruction?
    boolean
    Is this instruction a switch instruction?
    boolean
    Is this instruction a throw statement?
    List<org.objectweb.asm.Label>
    Jump to a label.
    void
    writeTo(org.objectweb.asm.MethodVisitor visitor)
    Write instruction to the method visitor.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BytecodeInstruction

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

      public BytecodeInstruction(int opcode, List<Object> args)
      Constructor.
      Parameters:
      opcode - Opcode.
      args - Arguments.
  • Method Details

    • writeTo

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

      public Iterable<org.xembly.Directive> directives(boolean counting)
      Specified by:
      directives in interface BytecodeEntry
    • 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.
    • isGoto

      public boolean isGoto()
      Is this instruction a jump instruction?
      Specified by:
      isGoto 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.
    • 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<org.objectweb.asm.Label> jumps()
      Jump to a label. Where to jump.
      Specified by:
      jumps in interface BytecodeEntry
      Returns:
      Jump label.
    • 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.