Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.bcel.generic: Javadoc index of package org.apache.bcel.generic.

Package Samples:



TargetLostException: Thrown by InstructionList.remove() when one or multiple disposed instruction are still being referenced by a InstructionTargeter object. I.e. the InstructionTargeter has to be notified that (one of) the InstructionHandle it is referencing is being removed from the InstructionList and thus not valid anymore. Making this an exception instead of a return value forces the user to handle these case explicitely in a try { ... } catch. The following code illustrates how this may be done: ... try { il.delete(start_ih, end_ih); } catch(TargetLostException e) { InstructionHandle[] targets = e.getTargets(); ...
ExceptionThrower: Denote an instruction that may throw a run-time or a linking exception (or both) during execution. This is not quite the truth as such; because all instructions may throw an java.lang.VirtualMachineError. These exceptions are omitted. The Lava Language Specification specifies exactly which RUN-TIME and which LINKING exceptions each instruction may throw which is reflected by the implementers. Due to the structure of the JVM specification, it may be possible that an Instruction implementing this interface returns a Class[] of size 0. Please note that we speak of an "exception" here when we mean ...
InstructionConstants: This interface contains shareable instruction objects. In order to save memory you can use some instructions multiply, since they have an immutable state and are directly derived from Instruction. I.e. they have no instance fields that could be changed. Since some of these instructions like ICONST_0 occur very frequently this can save a lot of time and space. This feature is an adaptation of the FlyWeight design pattern, we just use an array instead of a factory. The Instructions can also accessed directly under their names, so it's possible to write il.append(Instruction.ICONST_0);
InstructionHandle: Instances of this class give users a handle to the instructions contained in an InstructionList. Instruction objects may be used more than once within a list, this is useful because it saves memory and may be much faster. Within an InstructionList an InstructionHandle object is wrapped around all instructions, i.e., it implements a cell in a doubly-linked list. From the outside only the next and the previous instruction (handle) are accessible. One can traverse the list via an Enumeration returned by InstructionList.elements().
InstructionList: This class is a container for a list of Instruction objects. Instructions can be appended, inserted, moved, deleted, etc.. Instructions are being wrapped into InstructionHandles objects that are returned upon append/insert operations. They give the user (read only) access to the list structure, such that it can be traversed and manipulated in a controlled way. A list is finally dumped to a byte code array with getByteCode .
CodeExceptionGen: This class represents an exception handler, i.e., specifies the region where a handler is active and an instruction where the actual handling is done. pool as parameters. Opposed to the JVM specification the end of the handled region is set to be inclusive, i.e. all instructions between start and end are protected including the start and end instructions (handles) themselves. The end of the region is automatically mapped to be exclusive when calling getCodeException(), i.e., there is no difference semantically.
MethodGen: Template class for building up a method. This is done by defining exception handlers, adding thrown exceptions, local variables and attributes, whereas the `LocalVariableTable' and `LineNumberTable' attributes will be set automatically for the code. Use stripAttributes() if you don't like this. While generating code it may be necessary to insert NOP operations. You can use the `removeNOPs' method to get rid off them. The resulting method object can be obtained via the `getMethod()' method.
ConstantPoolGen: This class is used to build up a constant pool. The user adds constants via `addXXX' methods, `addString', `addClass', etc.. These methods return an index into the constant pool. Finally, `getFinalConstantPool()' returns the constant pool built up. Intermediate versions of the constant pool can be obtained with `getConstantPool()'. A constant pool has capacity for Constants.MAX_SHORT entries. Note that the first (0) is used by the JVM and that Double and Long constants need two slots.
CompoundInstruction: Wrapper class for `compound' operations, virtual instructions that don't exist as byte code, but give a useful meaning. For example, the (virtual) PUSH instruction takes an arbitray argument and produces the appropiate code at dump time (ICONST, LDC, BIPUSH, ...). Also you can use the SWITCH instruction as a useful template for either LOOKUPSWITCH or TABLESWITCH. The interface provides the possibilty for the user to write `templates' or `macros' for such reuseable code patterns.
InstructionComparator: Equality of instructions isn't clearly to be defined. You might wish, for example, to compare whether instructions have the same meaning. E.g., whether two INVOKEVIRTUALs describe the same call. The DEFAULT comparator however, considers two instructions to be equal if they have same opcode and point to the same indexes (if any) in the constant pool or the same local variable index. Branch instructions must have the same target.
LocalVariableGen: This class represents a local variable within a method. It contains its scope, name and type. The generated LocalVariable object can be obtained with getLocalVariable which needs the instruction list and the constant pool as parameters.
BranchHandle: BranchHandle is returned by specialized InstructionList.append() whenever a BranchInstruction is appended. This is useful when the target of this instruction is not known at time of creation and must be set later via setTarget().
InstructionFactory: Instances of this class may be used, e.g., to generate typed versions of instructions. Its main purpose is to be used as the byte code generating backend of a compiler. You can subclass it to add your own create methods.
Visitor: Interface implementing the Visitor pattern programming style. I.e., a class that implements this interface can handle all types of instructions with the properly typed methods just by calling the accept() method.
FieldGen: Template class for building up a field. The only extraordinary thing one can do is to add a constant value attribute to a field (which must of course be compatible with to the declared type).
SWITCH: SWITCH - Branch depending on int value, generates either LOOKUPSWITCH or TABLESWITCH instruction, depending on whether the match values (int[]) can be sorted with no gaps between the numbers.
INVOKESPECIAL: INVOKESPECIAL - Invoke instance method; special handling for superclass, private and instance initialization method invocations Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
BranchInstruction: Abstract super class for branching instructions like GOTO, IFEQ, etc.. Branch instructions may have a variable length, namely GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.
DUP2_X2: DUP2_X2 - Duplicate two top operand stack words and put four down Stack: ..., word4, word3, word2, word1 -> ..., word2, word1, word4, word3, word2, word1
GETFIELD: GETFIELD - Fetch field from object Stack: ..., objectref -> ..., value OR Stack: ..., objectref -> ..., value.word1, value.word2
PUTFIELD: PUTFIELD - Put field in object Stack: ..., objectref, value -> ... OR Stack: ..., objectref, value.word1, value.word2 -> ...
DUP2_X1: DUP2_X1 - Duplicate two top operand stack words and put three down Stack: ..., word3, word2, word1 -> ..., word2, word1, word3, word2, word1
Select: Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions. We use our super's target property as the default target.
DREM: DREM - Remainder of doubles Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -> ..., result.word1, result.word2
NEWARRAY: NEWARRAY - Create new array of basic type (int, short, ...) Stack: ..., count -> ..., arrayref type must be one of T_INT, T_SHORT, ...

Home | Contact Us | Privacy Policy | Terms of Service