|
|||||||||
| Home >> All >> com >> techtrader >> modules >> tools >> [ bytecode overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.techtrader.modules.tools.bytecode
Class Instruction

java.lang.Objectcom.techtrader.modules.tools.bytecode.Instruction
- All Implemented Interfaces:
- Constants, com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor
- Direct Known Subclasses:
- ArrayInstruction, ClassInstruction, CmpInstruction, ConstantInstruction, ConvertInstruction, FieldInstruction, JumpInstruction, LocalVariableInstruction, MathInstruction, MethodInstruction, MonitorInstruction, NewArrayInstruction, ReturnInstruction, StackInstruction
- public class Instruction
- extends java.lang.Object
- implements Constants, com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor
- extends java.lang.Object
An Instruction represents an opcode in a method of a Class.
| Field Summary | |
protected int |
_byteIndex
|
protected int |
_opcode
|
protected static java.util.List |
_opcodeTypes
|
protected Code |
_owner
|
| Constructor Summary | |
protected |
Instruction(Code owner)
Protected constructor. |
| Method Summary | |
void |
acceptVisit(com.techtrader.modules.tools.bytecode.visitor.BCVisitor visit)
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object. |
protected void |
copy(Instruction orig)
|
boolean |
equals(java.lang.Object other)
Instructions are equal if their opcodes are the same. |
int |
getByteIndex()
Get the index in the method code byte block at which this opcode starts. |
int |
getLength()
Return the length in bytes of this opcode, including all arguments. |
java.lang.String |
getName()
Get the name of this opcode. |
int |
getOpCode()
Get the opcode this instruction represents. |
Code |
getOwner()
Get the Code block that owns this Instruction. |
int |
getStackChange()
Return the number of stack positions this instruction pushes or pops during its execution. |
protected void |
invalidate()
Used when the Instruction is removed from the code block so that it can no longer affect the constant pool. |
protected void |
readData(java.io.DataInput in)
Read the arguments for this opcode from the given stream. |
void |
setByteIndex(int index)
Set the index in the method code byte block at which this opcode starts. |
protected void |
setOpCode(int opcode)
Set the opcode this instruction represents. |
protected void |
writeData(java.io.DataOutput out)
Write the arguments for this opcode to the given stream. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
_opcodeTypes
protected static final java.util.List _opcodeTypes
_owner
protected Code _owner
_opcode
protected int _opcode
_byteIndex
protected int _byteIndex
| Constructor Detail |
Instruction
protected Instruction(Code owner)
- Protected constructor.
| Method Detail |
getOwner
public Code getOwner()
- Get the Code block that owns this Instruction.
invalidate
protected void invalidate()
- Used when the Instruction is removed from the code block so that it
can no longer affect the constant pool.
getName
public java.lang.String getName()
- Get the name of this opcode.
getOpCode
public int getOpCode()
- Get the opcode this instruction represents.
setOpCode
protected void setOpCode(int opcode)
- Set the opcode this instruction represents.
setByteIndex
public void setByteIndex(int index)
- Set the index in the method code byte block at which this opcode starts.
Some opcodes rely on knowing where they appear in the method block
to be able to calculate their byte representations; therefore, this
method must be called before getLength(), readData(), or writeData().
getByteIndex
public int getByteIndex()
- Get the index in the method code byte block at which this opcode starts.
getLength
public int getLength()
- Return the length in bytes of this opcode, including all arguments.
This method should be overridden by opcodes that take arguments.
getStackChange
public int getStackChange()
- Return the number of stack positions this instruction pushes
or pops during its execution.
equals
public boolean equals(java.lang.Object other)
- Instructions are equal if their opcodes are the same. Subclasses
should override this method to perform a template comparison:
Instructions should compare equal to other Instructions of the same
type where the data is either the same or the data is unset.
copy
protected void copy(Instruction orig)
readData
protected void readData(java.io.DataInput in) throws java.io.IOException
- Read the arguments for this opcode from the given stream.
This method should be overridden by opcodes that take arguments.
writeData
protected void writeData(java.io.DataOutput out) throws java.io.IOException
- Write the arguments for this opcode to the given stream.
This method should be overridden by opcodes that take arguments.
acceptVisit
public void acceptVisit(com.techtrader.modules.tools.bytecode.visitor.BCVisitor visit)
- Description copied from interface:
com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor - Accept a visit from a BCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this object.
- Specified by:
acceptVisitin interfacecom.techtrader.modules.tools.bytecode.visitor.VisitAcceptor
|
|||||||||
| Home >> All >> com >> techtrader >> modules >> tools >> [ bytecode overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.techtrader.modules.tools.bytecode.Instruction