|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Instruction
This interface has to be implemented by every class representing a Java bytecode instruction
Method Summary | |
---|---|
java.lang.Object |
clone()
Performs the cloning of the current Instruction implementation. |
int |
fromArray(int[] bytecode,
int startFrom)
This method populates all the attributes of an Instruction implementation |
int |
getOpCode()
This method returns the instruction's numeric operation code as a byte . |
int[] |
getOperands()
This method returns the current operation operand stack. |
int |
getOperandsCount()
This method returns the number of operands required by the bytecode instruction. |
void |
setOpCode(int opCode)
This method sets the current operation code to the specified byte. |
void |
setOperands(int[] operands)
This method sets the current operation's operand stack. |
void |
setOperandsCountPosticipated(int[] bytecode,
int startFrom)
This method should be implemented by those classes wrapping JVM instructions whose number of operands is variable. |
int[] |
toArray()
This method returns the method's bytecode as an array. |
int |
updateRefs(int offset)
This method must implement the logic necessary to update all the references to constant pool table's entries contained within the bytecode instruction. |
Methods inherited from interface jef.dna.util.BytesCountable |
---|
getBytesCount |
Method Detail |
---|
int fromArray(int[] bytecode, int startFrom)
Instruction
implementation
bytecode
- The bytecode arraystartFrom
- The index of the current instruction's mnemonic (opcode)
int[] toArray()
int getOpCode()
byte
.
void setOpCode(int opCode)
opCode
- The int
representation of the operation code.void setOperandsCountPosticipated(int[] bytecode, int startFrom)
fromArray
method defined in
the InstructionAncestor
class. InstructionAncestor
already
contains an empty implementation of this method, useful for those classes exposing a prefixed
number of operands. In such a case there is no need to override the
setOperandsCountPosticipated
method,
bytecode
- The method's bytecodestartFrom
- The index of the current instruction's mnemonic (opcode)int[] getOperands()
void setOperands(int[] operands)
operands
- The operand stack as a int
array.int updateRefs(int offset)
offset
- The offset used for updating expressed as number of cpt's entries to be skipped
int getOperandsCount()
setOperands
method with the right number
of bytes as input parametr.
java.lang.Object clone() throws java.lang.CloneNotSupportedException
Instruction
implementation.
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |