Uses of Class
org.apache.bcel.generic.InstructionHandle
Packages that use InstructionHandle
Package
Description
Generic part of the Apache Byte Code Engineering Library (BCEL), classes to dynamically modify class objects
and byte code instructions.
Utility classes for the Apache Byte Code Engineering Library (BCEL), namely:
Collection classes for JavaClass objects
A converter for class files to HTML
A tool to find instructions patterns via regular expressions
A class to find classes as defined in the CLASSPATH
A class loader that allows to create classes at run time
A PassVerifier class mostly used internally by JustIce, yielding a control flow graph for public use as a nice side effect.
-
Uses of InstructionHandle in org.apache.bcel.generic
Subclasses of InstructionHandle in org.apache.bcel.genericModifier and TypeClassDescriptionfinal class
BranchHandle is returned by specialized InstructionList.append() whenever a BranchInstruction is appended.Fields in org.apache.bcel.generic declared as InstructionHandleModifier and TypeFieldDescriptionstatic final InstructionHandle[]
InstructionHandle.EMPTY_ARRAY
Empty array.private InstructionHandle
InstructionList.end
private InstructionHandle
LocalVariableGen.end
private InstructionHandle
CodeExceptionGen.endPc
private InstructionHandle
CodeExceptionGen.handlerPc
private InstructionHandle
LineNumberGen.ih
private InstructionHandle
InstructionHandle.next
private InstructionHandle
InstructionHandle.prev
private InstructionHandle
ReturnaddressType.returnTarget
private InstructionHandle
InstructionList.start
private InstructionHandle
LocalVariableGen.start
private InstructionHandle
CodeExceptionGen.startPc
protected InstructionHandle
BranchInstruction.target
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter(package private) final InstructionHandle
MethodGen.BranchTarget.target
protected InstructionHandle[]
Select.targets
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setterprivate final InstructionHandle[]
TargetLostException.targets
Fields in org.apache.bcel.generic with type parameters of type InstructionHandleModifier and TypeFieldDescriptionprivate final Hashtable
<InstructionHandle, MethodGen.BranchTarget> MethodGen.BranchStack.visitedTargets
Methods in org.apache.bcel.generic that return InstructionHandleModifier and TypeMethodDescriptionInstructionList.append
(CompoundInstruction c) Append a compound instruction.InstructionList.append
(Instruction i) Append an instruction to the end of this list.InstructionList.append
(InstructionHandle ih, CompoundInstruction c) Append a compound instruction.InstructionList.append
(InstructionHandle ih, Instruction i) Append an instruction after instruction (handle) ih contained in this list.InstructionList.append
(InstructionHandle ih, InstructionList il) Append another list after instruction (handle) ih contained in this list.InstructionList.append
(InstructionList il) Append another list to this one.InstructionList.append
(Instruction i, CompoundInstruction c) Append a compound instruction, after instruction i.InstructionList.append
(Instruction i, Instruction j) Append a single instruction j after another instruction i, which must be in this list of course!InstructionList.append
(Instruction i, InstructionList il) Append another list after instruction i contained in this list.InstructionList.findHandle
(int pos) Gets instruction handle for instruction at byte code position pos.static InstructionHandle
InstructionList.findHandle
(InstructionHandle[] ihs, int[] pos, int count, int target) Find the target instruction (handle) that corresponds to the given target position (byte code offset).private InstructionHandle
InstructionList.findInstruction1
(Instruction i) Search for given Instruction reference, start at beginning of list.private InstructionHandle
InstructionList.findInstruction2
(Instruction i) Search for given Instruction reference, start at end of listInstructionList.getEnd()
LocalVariableGen.getEnd()
CodeExceptionGen.getEndPC()
CodeExceptionGen.getHandlerPC()
LineNumberGen.getInstruction()
(package private) static InstructionHandle
InstructionHandle.getInstructionHandle
(Instruction i) Factory method.InstructionList.getInstructionHandles()
final InstructionHandle
InstructionHandle.getNext()
final InstructionHandle
InstructionHandle.getPrev()
InstructionList.getStart()
LocalVariableGen.getStart()
CodeExceptionGen.getStartPC()
BranchHandle.getTarget()
BranchInstruction.getTarget()
ReturnaddressType.getTarget()
(package private) final InstructionHandle
Select.getTarget
(int index) Select.getTargets()
TargetLostException.getTargets()
InstructionList.insert
(CompoundInstruction c) Insert a compound instruction.InstructionList.insert
(Instruction i) Insert an instruction at start of this list.InstructionList.insert
(InstructionHandle ih, CompoundInstruction c) Insert a compound instruction.InstructionList.insert
(InstructionHandle ih, Instruction i) Insert an instruction before instruction (handle) ih contained in this list.InstructionList.insert
(InstructionHandle ih, InstructionList il) Insert another list before Instruction handle ih contained in this list.InstructionList.insert
(InstructionList il) Insert another list.InstructionList.insert
(Instruction i, CompoundInstruction c) Insert a compound instruction before instruction i.InstructionList.insert
(Instruction i, Instruction j) Insert a single instruction j before another instruction i, which must be in this list of course!InstructionList.insert
(Instruction i, InstructionList il) Insert another list before Instruction i contained in this list.JsrInstruction.physicalSuccessor()
Returns an InstructionHandle to the physical successor of this JsrInstruction.(package private) final InstructionHandle
InstructionHandle.setNext
(InstructionHandle next) (package private) final InstructionHandle
InstructionHandle.setPrev
(InstructionHandle prev) Methods in org.apache.bcel.generic that return types with arguments of type InstructionHandleMethods in org.apache.bcel.generic with parameters of type InstructionHandleModifier and TypeMethodDescriptionMethodGen.addExceptionHandler
(InstructionHandle startPc, InstructionHandle endPc, InstructionHandle handlerPc, ObjectType catchType) Add an exception handler, i.e., specify region where a handler is active and an instruction where the actual handling is done.MethodGen.addLineNumber
(InstructionHandle ih, int srcLine) Give an instruction a line number corresponding to the source code line.MethodGen.addLocalVariable
(String name, Type type, int slot, InstructionHandle start, InstructionHandle end) Adds a local variable to this method.MethodGen.addLocalVariable
(String name, Type type, int slot, InstructionHandle start, InstructionHandle end, int origIndex) Adds a local variable to this method.MethodGen.addLocalVariable
(String name, Type type, InstructionHandle start, InstructionHandle end) Adds a local variable to this method and assigns an index automatically.private void
InstructionList.append
(InstructionHandle ih) Append an instruction to the end of this list.InstructionList.append
(InstructionHandle ih, BranchInstruction i) Append an instruction after instruction (handle) ih contained in this list.InstructionList.append
(InstructionHandle ih, CompoundInstruction c) Append a compound instruction.InstructionList.append
(InstructionHandle ih, Instruction i) Append an instruction after instruction (handle) ih contained in this list.InstructionList.append
(InstructionHandle ih, InstructionList il) Append another list after instruction (handle) ih contained in this list.boolean
InstructionList.contains
(InstructionHandle i) boolean
BranchInstruction.containsTarget
(InstructionHandle ih) boolean
CodeExceptionGen.containsTarget
(InstructionHandle ih) boolean
InstructionTargeter.containsTarget
(InstructionHandle ih) Checks whether this targeter targets the specified instruction handle.boolean
LineNumberGen.containsTarget
(InstructionHandle ih) boolean
LocalVariableGen.containsTarget
(InstructionHandle ih) boolean
Select.containsTarget
(InstructionHandle ih) static BranchInstruction
InstructionFactory.createBranchInstruction
(short opcode, InstructionHandle target) Create branch instruction by given opcode, except LOOKUPSWITCH and TABLESWITCH.void
InstructionList.delete
(InstructionHandle ih) Remove instruction from this list.void
InstructionList.delete
(InstructionHandle from, InstructionHandle to) Remove instructions from instruction 'from' to instruction 'to' contained in this list.static InstructionHandle
InstructionList.findHandle
(InstructionHandle[] ihs, int[] pos, int count, int target) Find the target instruction (handle) that corresponds to the given target position (byte code offset).protected int
BranchInstruction.getTargetOffset
(InstructionHandle target) private void
InstructionList.insert
(InstructionHandle ih) Insert an instruction at start of this list.InstructionList.insert
(InstructionHandle ih, BranchInstruction i) Insert an instruction before instruction (handle) ih contained in this list.InstructionList.insert
(InstructionHandle ih, CompoundInstruction c) Insert a compound instruction.InstructionList.insert
(InstructionHandle ih, Instruction i) Insert an instruction before instruction (handle) ih contained in this list.InstructionList.insert
(InstructionHandle ih, InstructionList il) Insert another list before Instruction handle ih contained in this list.void
InstructionList.move
(InstructionHandle ih, InstructionHandle target) Move a single instruction (handle) to a new location.void
InstructionList.move
(InstructionHandle start, InstructionHandle end, InstructionHandle target) Take all instructions (handles) from "start" to "end" and append them after the new location "target".(package private) static void
BranchInstruction.notifyTarget
(InstructionHandle oldIh, InstructionHandle newIh, InstructionTargeter t) Used by BranchInstruction, LocalVariableGen, CodeExceptionGen, LineNumberGenvoid
MethodGen.BranchStack.push
(InstructionHandle target, int stackDepth) void
InstructionList.redirectBranches
(InstructionHandle oldTarget, InstructionHandle newTarget) Redirect all references from oldTarget to newTarget, i.e., update targets of branch instructions.void
InstructionList.redirectExceptionHandlers
(CodeExceptionGen[] exceptions, InstructionHandle oldTarget, InstructionHandle newTarget) Redirect all references of exception handlers from oldTarget to newTarget.void
InstructionList.redirectLocalVariables
(LocalVariableGen[] lg, InstructionHandle oldTarget, InstructionHandle newTarget) Redirect all references of local variables from oldTarget to newTarget.private void
InstructionList.remove
(InstructionHandle prev, InstructionHandle next) Remove from instruction 'prev' to instruction 'next' both contained in this list.void
LocalVariableGen.setEnd
(InstructionHandle end) void
CodeExceptionGen.setEndPC
(InstructionHandle endPc) void
CodeExceptionGen.setHandlerPC
(InstructionHandle handlerPc) void
LineNumberGen.setInstruction
(InstructionHandle instructionHandle) (package private) final InstructionHandle
InstructionHandle.setNext
(InstructionHandle next) (package private) final InstructionHandle
InstructionHandle.setPrev
(InstructionHandle prev) void
LocalVariableGen.setStart
(InstructionHandle start) void
CodeExceptionGen.setStartPC
(InstructionHandle startPc) void
BranchHandle.setTarget
(InstructionHandle ih) Pass new target to instruction.void
BranchInstruction.setTarget
(InstructionHandle target) Sets branch targetvoid
Select.setTarget
(int i, InstructionHandle target) Sets branch target for 'i'th case(package private) final void
Select.setTargets
(InstructionHandle[] array) private static void
SWITCH.sort
(int l, int r, int[] match, InstructionHandle[] targets) Sorts match and targets array with QuickSort.void
BranchHandle.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) Update target of instruction.void
BranchInstruction.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) void
CodeExceptionGen.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) void
InstructionTargeter.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) Replaces the target of this targeter from this old handle to the new handle.void
LineNumberGen.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) void
LocalVariableGen.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) void
Select.updateTarget
(InstructionHandle oldIh, InstructionHandle newIh) private MethodGen.BranchTarget
MethodGen.BranchStack.visit
(InstructionHandle target, int stackDepth) private boolean
MethodGen.BranchStack.visited
(InstructionHandle target) Constructors in org.apache.bcel.generic with parameters of type InstructionHandleModifierConstructorDescriptionprotected
BranchInstruction
(short opcode, InstructionHandle target) Common super constructor(package private)
BranchTarget
(InstructionHandle target, int stackDepth) CodeExceptionGen
(InstructionHandle startPc, InstructionHandle endPc, InstructionHandle handlerPc, ObjectType catchType) Add an exception handler, i.e., specify region where a handler is active and an instruction where the actual handling is done.GOTO
(InstructionHandle target) GOTO_W
(InstructionHandle target) (package private)
GotoInstruction
(short opcode, InstructionHandle target) IF_ACMPEQ
(InstructionHandle target) IF_ACMPNE
(InstructionHandle target) IF_ICMPEQ
(InstructionHandle target) IF_ICMPGE
(InstructionHandle target) IF_ICMPGT
(InstructionHandle target) IF_ICMPLE
(InstructionHandle target) IF_ICMPLT
(InstructionHandle target) IF_ICMPNE
(InstructionHandle target) IFEQ
(InstructionHandle target) IFGE
(InstructionHandle target) IFGT
(InstructionHandle target) protected
IfInstruction
(short opcode, InstructionHandle target) IFLE
(InstructionHandle target) IFLT
(InstructionHandle target) IFNE
(InstructionHandle target) IFNONNULL
(InstructionHandle target) IFNULL
(InstructionHandle target) JSR
(InstructionHandle target) JSR_W
(InstructionHandle target) (package private)
JsrInstruction
(short opcode, InstructionHandle target) LineNumberGen
(InstructionHandle ih, int srcLine) Create a line number.LocalVariableGen
(int index, String name, Type type, InstructionHandle start, InstructionHandle end) Generate a local variable that with index 'index'.LocalVariableGen
(int index, String name, Type type, InstructionHandle start, InstructionHandle end, int origIndex) Generates a local variable that with index 'index'.LOOKUPSWITCH
(int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) ReturnaddressType
(InstructionHandle returnTarget) Creates a ReturnaddressType object with a target.(package private)
Select
(short opcode, int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) (Match, target) pairs for switch.SWITCH
(int[] match, InstructionHandle[] targets, InstructionHandle target) SWITCH
(int[] match, InstructionHandle[] targets, InstructionHandle target, int maxGap) Template for switch() constructs.TABLESWITCH
(int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) (package private)
TargetLostException
(InstructionHandle[] t, String mesg) -
Uses of InstructionHandle in org.apache.bcel.util
Fields in org.apache.bcel.util declared as InstructionHandleFields in org.apache.bcel.util with type parameters of type InstructionHandleModifier and TypeFieldDescriptionprivate final Map
<Instruction, InstructionHandle> BCELFactory.branchMap
Methods in org.apache.bcel.util that return InstructionHandleModifier and TypeMethodDescriptionprivate InstructionHandle[]
InstructionFinder.getMatch
(int matchedFrom, int matchLength) Methods in org.apache.bcel.util with parameters of type InstructionHandleModifier and TypeMethodDescriptionboolean
InstructionFinder.CodeConstraint.checkCode
(InstructionHandle[] match) final Iterator
<InstructionHandle[]> InstructionFinder.search
(String pattern, InstructionHandle from) Start search beginning from 'from'.final Iterator
<InstructionHandle[]> InstructionFinder.search
(String pattern, InstructionHandle from, InstructionFinder.CodeConstraint constraint) Search for the given pattern in the instruction list. -
Uses of InstructionHandle in org.apache.bcel.verifier.structurals
Fields in org.apache.bcel.verifier.structurals declared as InstructionHandleModifier and TypeFieldDescriptionprivate final InstructionHandle
ExceptionHandler.handlerPc
The InstructionHandle where the handling begins.private final InstructionHandle
ControlFlowGraph.InstructionContextImpl.instruction
The InstructionHandle this InstructionContext is wrapped around.private InstructionHandle
Subroutines.SubroutineImpl.theRET
The RET instruction that leaves this subroutine.Fields in org.apache.bcel.verifier.structurals with type parameters of type InstructionHandleModifier and TypeFieldDescriptionprivate final Map
<InstructionHandle, Set<ExceptionHandler>> ExceptionHandlers.exceptionHandlers
The ExceptionHandler instances.private final Map
<InstructionHandle, InstructionContext> ControlFlowGraph.instructionContexts
All InstructionContext instances of this ControlFlowGraph.private final Set
<InstructionHandle> Subroutines.SubroutineImpl.instructions
The instructions that belong to this subroutine.private final Map
<InstructionHandle, Subroutine> Subroutines.subroutines
The map containing the subroutines found.private final Set
<InstructionHandle> Subroutines.SubroutineImpl.theJSRs
The JSR or JSR_W instructions that define this subroutine by targeting it.Methods in org.apache.bcel.verifier.structurals that return InstructionHandleModifier and TypeMethodDescriptionprivate InstructionHandle[]
ControlFlowGraph.InstructionContextImpl._getSuccessors()
A utility method that calculates the successors of a given InstructionHandle That means, a RET does have successors as defined here.Subroutine.getEnteringJsrInstructions()
Returns all the JsrInstructions that have the first instruction of this subroutine as their target.Subroutines.SubroutineImpl.getEnteringJsrInstructions()
ExceptionHandler.getHandlerStart()
Returns the InstructionHandle where the handler starts off.ControlFlowGraph.InstructionContextImpl.getInstruction()
InstructionContext.getInstruction()
Returns the InstructionHandle this InstructionContext is wrapped around.Subroutine.getInstructions()
Returns all instructions that together form this subroutine.Subroutines.SubroutineImpl.getInstructions()
Subroutine.getLeavingRET()
Returns the one and only RET that leaves the subroutine.Subroutines.SubroutineImpl.getLeavingRET()
private static InstructionHandle[]
Subroutines.getSuccessors
(InstructionHandle instruction) A utility method that calculates the successors of a given InstructionHandle in the same subroutine.Methods in org.apache.bcel.verifier.structurals with parameters of type InstructionHandleModifier and TypeMethodDescriptionvoid
Subroutines.SubroutineImpl.addEnteringJsrInstruction
(InstructionHandle jsrInst) Adds a new JSR or JSR_W that has this subroutine as its target.(package private) void
Subroutines.SubroutineImpl.addInstruction
(InstructionHandle ih) boolean
Subroutine.contains
(InstructionHandle inst) Returns if the given InstructionHandle refers to an instruction that is part of this subroutine.boolean
Subroutines.SubroutineImpl.contains
(InstructionHandle inst) ControlFlowGraph.contextOf
(InstructionHandle inst) Returns the InstructionContext of a given instruction.ControlFlowGraph.contextsOf
(InstructionHandle[] insts) Returns the InstructionContext[] of a given InstructionHandle[], in a naturally ordered manner.ExceptionHandlers.getExceptionHandlers
(InstructionHandle ih) Returns all the ExceptionHandler instances representing exception handlers that protect the instruction ih.Subroutines.getSubroutine
(InstructionHandle leader) Returns the Subroutine object associated with the given leader (that is, the first instruction of the subroutine).private static InstructionHandle[]
Subroutines.getSuccessors
(InstructionHandle instruction) A utility method that calculates the successors of a given InstructionHandle in the same subroutine.boolean
ControlFlowGraph.isDead
(InstructionHandle i) Returns true, if and only if the said instruction is not reachable; that means, if it is not part of this ControlFlowGraph.Subroutines.subroutineOf
(InstructionHandle any) Returns the subroutine object associated with the given instruction.Constructors in org.apache.bcel.verifier.structurals with parameters of type InstructionHandleModifierConstructorDescription(package private)
ExceptionHandler
(ObjectType catchType, InstructionHandle handlerPc) Leave instance creation to JustIce.Creates an InstructionHandleImpl object from an InstructionHandle.