|
|||||||||
| 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 Code

java.lang.Objectcom.techtrader.modules.tools.bytecode.BCEntity
com.techtrader.modules.tools.bytecode.Attribute
com.techtrader.modules.tools.bytecode.Code
- All Implemented Interfaces:
- Constants, com.techtrader.modules.tools.bytecode.visitor.VisitAcceptor
Representation of a code block of a class. The methods of this class mimic those of the same name in the java.util.ListIterator class. Note that the size and index information of the Code block will change as opcodes are added.
Code blocks are usually obtained from a BCMethod, but can also be constructed via the default Constructor. Blocks created this way can be used to provide template instructions to the various search/replace methods in this class.
The Code class contains methods named after each JVM instruction, each of which adds the matching opcode to the code block at the current iterator position. There are also many pseudo-instruction methods that do not have a corresponding JVM opcode, but are provided for convenience when the exact opcode is difficult to determine at compile time. Unlike the other opcode methods, these convenience methods have javadoc comments so that they are easy to pick out; they should be skimmed to get an idea of the functionality that each provides. Also note that many Instructions are able to 'morph' their opcode on the fly as the arguments to the instruction change. Thus the developer can initially call, for example, the aload_1 opcode, but later change the type to load to 'int', and the opcode will automatically morph to iload_1.
| Field Summary | |
private java.util.List |
_handlers
|
private java.util.ListIterator |
_li
|
private int |
_maxLocals
|
private int |
_maxStack
|
private java.util.List |
_opcodes
|
| Fields inherited from class com.techtrader.modules.tools.bytecode.Attribute |
_nameIndex, _owner |
| Fields inherited from class com.techtrader.modules.tools.bytecode.BCEntity |
|
| Constructor Summary | |
|
Code()
The public constructor is for creating template code modules that can be used to produce Instructions to be used in matching for various search() and replace() methods. |
protected |
Code(int nameIndex,
BCEntity owner)
|
JAVADOC