| Home >> All >> com >> techtrader >> modules |
| | com.techtrader.modules.tools.* (73) | | com.techtrader.modules.tools.bytecode.* (73) |
| | com.techtrader.modules.tools.bytecode.lowlevel.* (17) | | com.techtrader.modules.tools.bytecode.visitor.* (3) |
Package Samples:
com.techtrader.modules.tools.bytecode
com.techtrader.modules.tools.bytecode.lowlevel
com.techtrader.modules.tools.bytecode.visitor
Classes:
Code: 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 ...
ConstantPool: Represents a class constant pool, containing entries for all strings, constants, classes, etc referenced in the class structure and opcodes. In keeping with the low-level bytecode representation, all pool indexes are 1-based. NOTE: Entries are not meant to be manipulated manually. If you change entries by hand, make sure to call the rehash(com.techtrader.modules.tools.bytecode.lowlevel.Entry, int) 55 method of the ConstantPool so that the entry is hashed correctly for quick lookups and to avoid duplicates. NOTE: LongEntries and DoubleEntries are always followed by a PlaceHolderEntry in the pool, ...
BCVisitor: Base class for visitors on a bytecode class. The public visit method will traverse the object graph of the given entity, calling the enter* and exit* methods as it visits each object. The traversal is done depth-first. Subclasses should override only the methods for visiting the entities they are interested in. Whenever there is a general method (i.e. enter/exitEntry) as well as a more specific one (i.e. enter/exitStringEntry), the more general method will be called first, followed by a call on the correct specific method. Most subclasses will override either the general or specific cases, but ...
LocalVariableInstruction: Represents an instruction that has an argument of an index into the local variable array of the current frame. This includes most of the LOAD and STORE instructions. The local variable array size is fixed by the 'maxLocals' property of the code block. Long and double types take up 2 local variable indexes. Parameter values to methods are loaded into the local variable array prior to the execution of the first instruction. The 0th-index of the array is set to the instance of the class the method is being invoked on.
ConvertInstruction: Represents one of the conversion opcodes defined in the Constants interface for converting between primitive types. Changing the types of the instruction will automatically update the underlying opcode. If converting from one type to the same type will result in a NOP. Note that the result of conversions not supported directly by the JVM (i.e. char to double) is undefined.
BCClass: Start here to understand this package. A BCClass is a representation of a bytecode class. It contains methods to manipulate the class object itself as well as methods to manage the fields and methods of the class. As with most entities in the bytecode framework, there are methods to manipulate the low-level state of the class (constant pool indexes, etc), but these methods can safely be ignored in favor of the available high-level methods.
MathInstruction: Represents one of the math operations defined in the Constants interface. Changing the type or operation of the instruction will automatically update the underlying opcode. Note, however, that some operations cannot act on floating point types.
ClassConstantInstruction: Pseudo-instruction used to place Class types onto the stack. This logical instruction may actually involve a large chunk of code, and may even add static synthetic fields and methods to the owning class. Therefore, once the type of Class being loaded is set, it cannot be chanced. Also, this instruction is invalid as the target of any jump instruction or exception handler.
StackInstruction: Represents an instruction that manipulates the stack of the current frame. Using the setType methods is a hint about the type being manipulated that might cause this Instruction to use the wide version of the opcode it represents (if manipulating a long or double). This saves the developer from having to decide at compile time whether to use pop() or pop2(), etc.
ConstantInstruction: Represents an instruction that that loads a constant onto the stack. The opcode represented by this Instruction may change depending on the type and value of the constant set. For example, if the constant value is initially set to '5', the opcode will be iconst_5; if later incremented to '6', the opcode will be changed to bipush(6).
ClassEntry: Low-level representation of a constant pool entry describing a Class. Class entries are used to refer to the compiled class, the superclass, implemented interfaces, field types, etc. Each ClassEntry contains an index into the constant pool of the UTF8Entry that stores the class name, which is represented in internal form.
InnerClassesAttribute: Attribute describing the inner classes of a .class file. Note: for methods that take in the name of the inner class, this refers to the short name it is referred to be within the owning class, not the full name. For anonymous inner classes, use the empty String. TODO: Import and copy methods are broken.
BCMethod: Representation of a bytecode method of a class; a BCMethod can only be obtained from a BCClass. Note that this class has method to manipulate its declared excptions and code for convenience only; they can be manipulated directly through the ATTR_EXCEPTIONS and ATTR_CODE attributes.
LowLevelConstants: Interface to track constants used in lowlevel bytecode. Entities can access these constants using the static LowLevelConstants. field prefix, or implement this interface themselves to conveniently import the constants into their own namespace.
Constants: Interface to track constants used in bytecode. Entities can access these constants using the static Constants. field prefix, or implement this interface themselves to conveniently import the constants into their own namespace.
Attribute: Representation of an attribute in a .class file. Attributes are used to represent constants and the code of methods, among other things. All attributes contain at a minimum a name, which is immutable, as it determines the attribute's type.
LineNumberTableAttribute: A LineNumberTableAttributs holds a table of line number to program counter mappings, so that errors can be reported with the correct line number. TODO: Allow high-level manipulation of the line numbers.
PlaceHolderEntry: The PlaceHolderEntry is inserted into the constant pool after LongEntries and DoubleEntries to maintain the proper indexing, as these types take up 2 indeces in the constant pool.
WideInstruction: Representation of the WIDE instruction, which is used to allow other instructions to index values beyond what they can normally index baed on the length of their arguments.
Entry: Base interface for all constant pool entries. Every Entry has a one-byte code representing the type of Entry, where each entry type may contain different information.
VisitAcceptor: Interface denoting an entity that can accept a BCVisitor and provide its internal state to it. All entities in the bytecode framework implement this interface.
LocalVariableTableAttribute: Represents a local variable table for a method. TODO: Variables of type long or double should occupy two indeces; this is not taken into account here.
BCEntity: Abstract superclass for all complex bytecode entities. All bytecode entities contain attributes and are able to access the constant pool.
PrettyPrintVisitor: Visitor type that outputs a detailed, formatted document of the visited entity; similar to the javap -c command but more detailed.
FieldInstruction: Represents an instruction that takes as an argument a field to operate on. Examples include GETFIELD, GETSTATIC, SETFIELD, SETSTATIC.
| Home | Contact Us | Privacy Policy | Terms of Service |