Class BytecodeInstruction
java.lang.Object
org.eolang.jeo.representation.bytecode.BytecodeInstruction
- All Implemented Interfaces:
BytecodeEntry
Bytecode instruction.
- Since:
- 0.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.xembly.Directive>
Convert entry to directives.int
impact()
Impact of each instruction on the stack.boolean
isIf()
Is this instruction a conditional branch instruction?boolean
isJump()
Is this instruction a jump instruction? Is it a goto or jsr?boolean
isLabel()
Is this instruction a label?boolean
isOpcode()
Is this instruction a regular opcode?boolean
isReturn()
Is this instruction a return instruction?boolean
isSwitch()
Is this instruction a switch instruction?boolean
isThrow()
Is this instruction a throw statement?jumps()
Jump to a label.view()
Human-readable representation.void
Write instruction to the method visitor.
-
Constructor Details
-
BytecodeInstruction
Constructor.- Parameters:
opcode
- Opcode.args
- Arguments.
-
-
Method Details
-
writeTo
Description copied from interface:BytecodeEntry
Write instruction to the method visitor.- Specified by:
writeTo
in interfaceBytecodeEntry
- Parameters:
visitor
- Method visitor.labels
- Method labels.
-
directives
Description copied from interface:BytecodeEntry
Convert entry to directives.- Specified by:
directives
in interfaceBytecodeEntry
- Returns:
- Directives.
-
isLabel
public boolean isLabel()Description copied from interface:BytecodeEntry
Is this instruction a label?- Specified by:
isLabel
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isOpcode
public boolean isOpcode()Description copied from interface:BytecodeEntry
Is this instruction a regular opcode?- Specified by:
isOpcode
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
impact
public int impact()Impact of each instruction on the stack.- Specified by:
impact
in interfaceBytecodeEntry
- Returns:
- Stack impact.
-
isJump
public boolean isJump()Is this instruction a jump instruction? Is it a goto or jsr?- Specified by:
isJump
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isIf
public boolean isIf()Is this instruction a conditional branch instruction?- Specified by:
isIf
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isSwitch
public boolean isSwitch()Is this instruction a switch instruction?- Specified by:
isSwitch
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isReturn
public boolean isReturn()Is this instruction a return instruction?- Specified by:
isReturn
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
jumps
Jump to a label. Where to jump.- Specified by:
jumps
in interfaceBytecodeEntry
- Returns:
- Jump label.
-
view
Description copied from interface:BytecodeEntry
Human-readable representation.- Specified by:
view
in interfaceBytecodeEntry
- Returns:
- Text.
-
isThrow
public boolean isThrow()Description copied from interface:BytecodeEntry
Is this instruction a throw statement?- Specified by:
isThrow
in interfaceBytecodeEntry
- Returns:
- True if it is.
-