Package org.apache.bcel.generic
This package contains the "generic" part of the Byte Code Engineering Library, i.e., classes to dynamically modify class objects and byte code instructions.
-
Interface Summary Interface Description AllocationInstruction Denote family of instructions that allocates space in the heap.ClassObserver Implement this interface if you're interested in changes to a ClassGen object and register yourself with addObserver().CompoundInstruction Wrapper class for `compound' operations, virtual instructions that don't exist as byte code, but give a useful meaning.ConstantPushInstruction Denotes a push instruction that produces a literal on the stack such as SIPUSH, BIPUSH, ICONST, etc.ExceptionThrower Denote an instruction that may throw a run-time or a linking exception (or both) during execution.FieldObserver Imnplement this interface if you're interested in changes to a FieldGen object and register yourself with addObserver().IndexedInstruction Denote entity that refers to an index, e.g.InstructionComparator Equality of instructions isn't clearly to be defined.InstructionConstants Deprecated. (since 6.0) Do not use.InstructionListObserver Implement this interface if you're interested in changes to an InstructionList object and register yourself with addObserver().InstructionTargeter Denote that a class targets InstructionHandles within an InstructionList.LoadClass Denotes that an instruction may start the process of loading and resolving the referenced class in the Virtual Machine.MethodObserver Implement this interface if you're interested in changes to a MethodGen object and register yourself with addObserver().NamedAndTyped Denote entity that has both name and type.PopInstruction Denotes an unparameterized instruction to pop a value on top from the stack, such as ISTORE, POP, PUTSTATIC.PushInstruction Denotes an unparameterized instruction to produce a value on top of the stack, such as ILOAD, LDC, SIPUSH, DUP, ICONST, etc.StackConsumer Denote an instruction that may consume a value from the stack.StackProducer Denote an instruction that may produce a value on top of the stack (this excludes DUP_X1, e.g.)TypedInstruction Get the type associated with an instruction, int for ILOAD, or the type of the field of a PUTFIELD instruction, e.g..UnconditionalBranch Denotes an instruction to perform an unconditional branch, i.e., GOTO, JSR.VariableLengthInstruction Denotes an instruction to be a variable length instruction, such as GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.Visitor Interface implementing the Visitor pattern programming style. -
Class Summary Class Description AALOAD AALOAD - Load reference from arrayAASTORE AASTORE - Store into reference arrayACONST_NULL ACONST_NULL - Push null referenceALOAD ALOAD - Load reference from local variableANEWARRAY ANEWARRAY - Create new array of referencesAnnotationElementValueGen AnnotationEntryGen ARETURN ARETURN - Return reference from methodArithmeticInstruction Super class for the family of arithmetic instructions.ArrayElementValueGen ArrayInstruction Super class for instructions dealing with array access such as IALOAD.ARRAYLENGTH ARRAYLENGTH - Get length of arrayArrayType Denotes array type, such as int[][]ASTORE ASTORE - Store reference into local variableATHROW ATHROW - Throw exceptionBALOAD BALOAD - Load byte or boolean from arrayBasicType Denotes basic type such as int.BASTORE BASTORE - Store into byte or boolean arrayBIPUSH BIPUSH - Push byte on stackBranchHandle BranchHandle is returned by specialized InstructionList.append() whenever a BranchInstruction is appended.BranchInstruction Abstract super class for branching instructions like GOTO, IFEQ, etc..BREAKPOINT BREAKPOINT, JVM dependent, ignored by defaultCALOAD CALOAD - Load char from arrayCASTORE CASTORE - Store into char arrayCHECKCAST CHECKCAST - Check whether object is of given typeClassElementValueGen ClassGen Template class for building up a java class.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.ConstantPoolGen This class is used to build up a constant pool.ConversionInstruction Super class for the x2y family of instructions.CPInstruction Abstract super class for instructions that use an index into the constant pool such as LDC, INVOKEVIRTUAL, etc.D2F D2F - Convert double to floatD2I D2I - Convert double to intD2L D2L - Convert double to longDADD DADD - Add doublesDALOAD DALOAD - Load double from arrayDASTORE DASTORE - Store into double arrayDCMPG DCMPG - Compare doubles: value1 > value2DCMPL DCMPL - Compare doubles: value1 < value2DCONST DCONST - Push 0.0 or 1.0, other values cause an exceptionDDIV DDIV - Divide doublesDLOAD DLOAD - Load double from local variableDMUL DMUL - Multiply doublesDNEG DNEG - Negate doubleDREM DREM - Remainder of doublesDRETURN DRETURN - Return double from methodDSTORE DSTORE - Store double into local variableDSUB DSUB - Substract doublesDUP DUP - Duplicate top operand stack wordDUP_X1 DUP_X1 - Duplicate top operand stack word and put two downDUP_X2 DUP_X2 - Duplicate top operand stack word and put three downDUP2 DUP2 - Duplicate two top operand stack wordsDUP2_X1 DUP2_X1 - Duplicate two top operand stack words and put three downDUP2_X2 DUP2_X2 - Duplicate two top operand stack words and put four downElementValueGen ElementValuePairGen EmptyVisitor Supplies empty method bodies to be overridden by subclasses.EnumElementValueGen F2D F2D - Convert float to doubleF2I F2I - Convert float to intF2L F2L - Convert float to longFADD FADD - Add floatsFALOAD FALOAD - Load float from arrayFASTORE FASTORE - Store into float arrayFCMPG FCMPG - Compare floats: value1 > value2FCMPL FCMPL - Compare floats: value1 < value2FCONST FCONST - Push 0.0, 1.0 or 2.0, other values cause an exceptionFDIV FDIV - Divide floatsFieldGen Template class for building up a field.FieldGenOrMethodGen Super class for FieldGen and MethodGen objects, since they have some methods in common!FieldInstruction Super class for the GET/PUTxxx family of instructions.FieldOrMethod Super class for InvokeInstruction and FieldInstruction, since they have some methods in common!FLOAD FLOAD - Load float from local variableFMUL FMUL - Multiply floatsFNEG FNEG - Negate floatFREM FREM - Remainder of floatsFRETURN FRETURN - Return float from methodFSTORE FSTORE - Store float into local variableFSUB FSUB - Substract floatsGETFIELD GETFIELD - Fetch field from objectGETSTATIC GETSTATIC - Fetch static field from classGOTO GOTO - Branch always (to relative offset, not absolute address)GOTO_W GOTO_W - Branch always (to relative offset, not absolute address)GotoInstruction Super class for GOTOI2B I2B - Convert int to byteI2C I2C - Convert int to charI2D I2D - Convert int to doubleI2F I2F - Convert int to floatI2L I2L - Convert int to longI2S I2S - Convert int to shortIADD IADD - Add intsIALOAD IALOAD - Load int from arrayIAND IAND - Bitwise AND intIASTORE IASTORE - Store into int arrayICONST ICONST - Push value between -1, ..., 5, other values cause an exceptionIDIV IDIV - Divide intsIF_ACMPEQ IF_ACMPEQ - Branch if reference comparison succeedsIF_ACMPNE IF_ACMPNE - Branch if reference comparison doesn't succeedIF_ICMPEQ IF_ICMPEQ - Branch if int comparison succeedsIF_ICMPGE IF_ICMPGE - Branch if int comparison succeedsIF_ICMPGT IF_ICMPGT - Branch if int comparison succeedsIF_ICMPLE IF_ICMPLE - Branch if int comparison succeedsIF_ICMPLT IF_ICMPLT - Branch if int comparison succeedsIF_ICMPNE IF_ICMPNE - Branch if int comparison doesn't succeedIFEQ IFEQ - Branch if int comparison with zero succeedsIFGE IFGE - Branch if int comparison with zero succeedsIFGT IFGT - Branch if int comparison with zero succeedsIfInstruction Super class for the IFxxx family of instructions.IFLE IFLE - Branch if int comparison with zero succeedsIFLT IFLT - Branch if int comparison with zero succeedsIFNE IFNE - Branch if int comparison with zero succeedsIFNONNULL IFNONNULL - Branch if reference is not nullIFNULL IFNULL - Branch if reference is not nullIINC IINC - Increment local variable by constantILOAD ILOAD - Load int from local variable onto stackIMPDEP1 IMPDEP1 - Implementation dependentIMPDEP2 IMPDEP2 - Implementation dependentIMUL IMUL - Multiply intsINEG INEG - Negate intINSTANCEOF INSTANCEOF - Determine if object is of given typeInstruction Abstract super class for all Java byte codes.InstructionConst This interface contains shareable instruction objects.InstructionConstants.Clinit InstructionFactory Instances of this class may be used, e.g., to generate typed versions of instructions.InstructionHandle Instances of this class give users a handle to the instructions contained in an InstructionList.InstructionList This class is a container for a list of Instruction objects.INVOKEDYNAMIC Class for INVOKEDYNAMIC.InvokeInstruction Super class for the INVOKExxx family of instructions.INVOKEINTERFACE INVOKEINTERFACE - Invoke interface methodINVOKESPECIAL INVOKESPECIAL - Invoke instance method; special handling for superclass, private and instance initialization method invocationsINVOKESTATIC INVOKESTATIC - Invoke a class (static) methodINVOKEVIRTUAL INVOKEVIRTUAL - Invoke instance method; dispatch based on classIOR IOR - Bitwise OR intIREM IREM - Remainder of intIRETURN IRETURN - Return int from methodISHL ISHL - Arithmetic shift left intISHR ISHR - Arithmetic shift right intISTORE ISTORE - Store int from stack into local variableISUB ISUB - Substract intsIUSHR IUSHR - Logical shift right intIXOR IXOR - Bitwise XOR intJSR JSR - Jump to subroutineJSR_W JSR_W - Jump to subroutineJsrInstruction Super class for JSR - Jump to subroutineL2D L2D - Convert long to doubleL2F L2F - Convert long to floatL2I L2I - Convert long to intLADD LADD - Add longsLALOAD LALOAD - Load long from arrayLAND LAND - Bitwise AND longsLASTORE LASTORE - Store into long arrayLCMP LCMP - Compare longs:LCONST LCONST - Push 0 or 1, other values cause an exceptionLDC LDC - Push item from constant pool.LDC_W LDC_W - Push item from constant pool (wide index)LDC2_W LDC2_W - Push long or double from constant poolLDIV LDIV - Divide longsLineNumberGen This class represents a line number within a method, i.e., give an instruction a line number corresponding to the source code line.LLOAD LLOAD - Load long from local variableLMUL LMUL - Multiply longsLNEG LNEG - Negate longLoadInstruction Denotes an unparameterized instruction to load a value from a local variable, e.g.LocalVariableGen Represents a local variable within a method.LocalVariableInstruction Abstract super class for instructions dealing with local variables.LOOKUPSWITCH LOOKUPSWITCH - Switch with unordered set of valuesLOR LOR - Bitwise OR longLREM LREM - Remainder of longLRETURN LRETURN - Return long from methodLSHL LSHL - Arithmetic shift left longLSHR LSHR - Arithmetic shift right longLSTORE LSTORE - Store long into local variableLSUB LSUB - Substract longsLUSHR LUSHR - Logical shift right longLXOR LXOR - Bitwise XOR longMethodGen Template class for building up a method.MONITORENTER MONITORENTER - Enter monitor for objectMONITOREXIT MONITOREXIT - Exit monitor for objectMULTIANEWARRAY MULTIANEWARRAY - Create new mutidimensional array of referencesNameSignatureInstruction Super class for FieldOrMethod and INVOKEDYNAMIC, since they both have names and signaturesNEW NEW - Create new objectNEWARRAY NEWARRAY - Create new array of basic type (int, short, ...)NOP NOP - Do nothingObjectType Denotes reference such as java.lang.String.POP POP - Pop top operand stack wordPOP2 POP2 - Pop two top operand stack wordsPUSH Wrapper class for push operations, which are implemented either as BIPUSH, LDC or xCONST_n instructions.PUTFIELD PUTFIELD - Put field in objectPUTSTATIC PUTSTATIC - Put static field in classReferenceType Super class for object and array types.RET RET - Return from subroutineRETURN RETURN - Return from void methodReturnaddressType Returnaddress, the type JSR or JSR_W instructions push upon the stack.ReturnInstruction Super class for the xRETURN family of instructions.SALOAD SALOAD - Load short from arraySASTORE SASTORE - Store into short arraySelect Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.SimpleElementValueGen SIPUSH SIPUSH - Push shortStackInstruction Super class for stack operations like DUP and POP.StoreInstruction Denotes an unparameterized instruction to store a value into a local variable, e.g.SWAP SWAP - Swa top operand stack wordSWITCH 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.TABLESWITCH TABLESWITCH - Switch within given range of values, i.e., low..highType Abstract super class for all possible java types, namely basic types such as int, object types like String and array types, e.g. -
Exception Summary Exception Description ClassGenException Thrown on internal errors.TargetLostException Thrown by InstructionList.remove() when one or multiple disposed instructions are still being referenced by an InstructionTargeter object.