Class BytecodeInstruction
java.lang.Object
org.eolang.jeo.representation.bytecode.BytecodeInstruction
- All Implemented Interfaces:
BytecodeEntry
Bytecode instruction.
- Since:
- 0.1
-
Constructor Summary
ConstructorsConstructorDescriptionBytecodeInstruction(int opcode, Object... args) Constructor.BytecodeInstruction(int opcode, List<Object> args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.xembly.Directive>directives(boolean counting) intimpact()Impact of each instruction on the stack.booleanisGoto()Is this instruction a jump instruction?booleanisIf()Is this instruction a conditional branch instruction?booleanisLabel()Is this instruction a label?booleanisOpcode()Is this instruction a regular opcode?booleanisReturn()Is this instruction a return instruction?booleanisSwitch()Is this instruction a switch instruction?booleanisThrow()Is this instruction a throw statement?List<org.objectweb.asm.Label>jumps()Jump to a label.voidwriteTo(org.objectweb.asm.MethodVisitor visitor) Write instruction to the method visitor.
-
Constructor Details
-
BytecodeInstruction
Constructor.- Parameters:
opcode- Opcode.args- Arguments.
-
BytecodeInstruction
Constructor.- Parameters:
opcode- Opcode.args- Arguments.
-
-
Method Details
-
writeTo
public void writeTo(org.objectweb.asm.MethodVisitor visitor) Description copied from interface:BytecodeEntryWrite instruction to the method visitor.- Specified by:
writeToin interfaceBytecodeEntry- Parameters:
visitor- Method visitor.
-
directives
- Specified by:
directivesin interfaceBytecodeEntry
-
isLabel
public boolean isLabel()Description copied from interface:BytecodeEntryIs this instruction a label?- Specified by:
isLabelin interfaceBytecodeEntry- Returns:
- True if it is.
-
isOpcode
public boolean isOpcode()Description copied from interface:BytecodeEntryIs this instruction a regular opcode?- Specified by:
isOpcodein interfaceBytecodeEntry- Returns:
- True if it is.
-
impact
public int impact()Impact of each instruction on the stack.- Specified by:
impactin interfaceBytecodeEntry- Returns:
- Stack impact.
-
isGoto
public boolean isGoto()Is this instruction a jump instruction?- Specified by:
isGotoin interfaceBytecodeEntry- Returns:
- True if it is.
-
isIf
public boolean isIf()Is this instruction a conditional branch instruction?- Specified by:
isIfin interfaceBytecodeEntry- Returns:
- True if it is.
-
isSwitch
public boolean isSwitch()Is this instruction a switch instruction?- Specified by:
isSwitchin interfaceBytecodeEntry- Returns:
- True if it is.
-
isReturn
public boolean isReturn()Is this instruction a return instruction?- Specified by:
isReturnin interfaceBytecodeEntry- Returns:
- True if it is.
-
jumps
Jump to a label. Where to jump.- Specified by:
jumpsin interfaceBytecodeEntry- Returns:
- Jump label.
-
isThrow
public boolean isThrow()Description copied from interface:BytecodeEntryIs this instruction a throw statement?- Specified by:
isThrowin interfaceBytecodeEntry- Returns:
- True if it is.
-