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 classBranchHandle 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_ARRAYEmpty array.private InstructionHandleInstructionList.endprivate InstructionHandleLocalVariableGen.endprivate InstructionHandleCodeExceptionGen.endPcprivate InstructionHandleCodeExceptionGen.handlerPcprivate InstructionHandleLineNumberGen.ihprivate InstructionHandleInstructionHandle.nextprivate InstructionHandleInstructionHandle.prevprivate InstructionHandleReturnaddressType.returnTargetprivate InstructionHandleInstructionList.startprivate InstructionHandleLocalVariableGen.startprivate InstructionHandleCodeExceptionGen.startPcprotected InstructionHandleBranchInstruction.targetDeprecated.(since 6.0) will be made private; do not access directly, use getter/setter(package private) final InstructionHandleMethodGen.BranchTarget.targetprotected InstructionHandle[]Select.targetsDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprivate final InstructionHandle[]TargetLostException.targetsThe target instruction handles that were lost.Fields in org.apache.bcel.generic with type parameters of type InstructionHandleModifier and TypeFieldDescriptionprivate final Hashtable<InstructionHandle,MethodGen.BranchTarget> MethodGen.BranchStack.visitedTargetsMethods 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 InstructionHandleInstructionList.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 InstructionHandleInstructionList.findInstruction1(Instruction i) Search for given Instruction reference, start at beginning of list.private InstructionHandleInstructionList.findInstruction2(Instruction i) Search for given Instruction reference, start at end of listInstructionList.getEnd()Gets the end of list.LocalVariableGen.getEnd()Gets the end instruction handle.CodeExceptionGen.getEndPC()Gets the end of handled region (inclusive).CodeExceptionGen.getHandlerPC()Gets the start of handler.LineNumberGen.getInstruction()Gets the instruction handle.(package private) static InstructionHandleInstructionHandle.getInstructionHandle(Instruction i) Factory method.InstructionList.getInstructionHandles()Gets array containing all instructions.final InstructionHandleInstructionHandle.getNext()Gets the next instruction handle.final InstructionHandleInstructionHandle.getPrev()Gets the previous instruction handle.InstructionList.getStart()Gets the start of list.LocalVariableGen.getStart()Gets the start instruction handle.CodeExceptionGen.getStartPC()Gets the start of handled region (inclusive).BranchHandle.getTarget()Gets the target of instruction.BranchInstruction.getTarget()Gets the target of branch instruction.ReturnaddressType.getTarget()Gets the target of this ReturnaddressType.(package private) final InstructionHandleSelect.getTarget(int index) Select.getTargets()Gets the match targets.TargetLostException.getTargets()Gets the list of instructions still being targeted.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 InstructionHandleInstructionHandle.setNext(InstructionHandle next) Sets the next instruction handle.(package private) final InstructionHandleInstructionHandle.setPrev(InstructionHandle prev) Sets the previous instruction handle.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, that is, 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 voidInstructionList.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.booleanInstructionList.contains(InstructionHandle i) Checks if the list contains the given instruction handle.booleanBranchInstruction.containsTarget(InstructionHandle ih) booleanCodeExceptionGen.containsTarget(InstructionHandle ih) booleanInstructionTargeter.containsTarget(InstructionHandle instructionHandle) Tests whether this targeter targets the specified instruction handle.booleanLineNumberGen.containsTarget(InstructionHandle ih) booleanLocalVariableGen.containsTarget(InstructionHandle ih) booleanSelect.containsTarget(InstructionHandle ih) static BranchInstructionInstructionFactory.createBranchInstruction(short opcode, InstructionHandle target) Create branch instruction by given opcode, except LOOKUPSWITCH and TABLESWITCH.voidInstructionList.delete(InstructionHandle ih) Remove instruction from this list.voidInstructionList.delete(InstructionHandle from, InstructionHandle to) Remove instructions from instruction 'from' to instruction 'to' contained in this list.static InstructionHandleInstructionList.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 intBranchInstruction.getTargetOffset(InstructionHandle target) Gets the offset to target relative to this instruction.private voidInstructionList.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.voidInstructionList.move(InstructionHandle ih, InstructionHandle target) Move a single instruction (handle) to a new location.voidInstructionList.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 voidBranchInstruction.notifyTarget(InstructionHandle oldIh, InstructionHandle newIh, InstructionTargeter t) Used by BranchInstruction, LocalVariableGen, CodeExceptionGen, LineNumberGenvoidMethodGen.BranchStack.push(InstructionHandle target, int stackDepth) voidInstructionList.redirectBranches(InstructionHandle oldTarget, InstructionHandle newTarget) Redirect all references from oldTarget to newTarget, that is, update targets of branch instructions.voidInstructionList.redirectExceptionHandlers(CodeExceptionGen[] exceptions, InstructionHandle oldTarget, InstructionHandle newTarget) Redirect all references of exception handlers from oldTarget to newTarget.voidInstructionList.redirectLocalVariables(LocalVariableGen[] lg, InstructionHandle oldTarget, InstructionHandle newTarget) Redirect all references of local variables from oldTarget to newTarget.private voidInstructionList.remove(InstructionHandle prev, InstructionHandle next) Remove from instruction 'prev' to instruction 'next' both contained in this list.voidLocalVariableGen.setEnd(InstructionHandle end) Sets the end instruction handle.voidCodeExceptionGen.setEndPC(InstructionHandle endPc) Sets end of handler.voidCodeExceptionGen.setHandlerPC(InstructionHandle handlerPc) Sets handler code.voidLineNumberGen.setInstruction(InstructionHandle instructionHandle) Sets the instruction handle.(package private) final InstructionHandleInstructionHandle.setNext(InstructionHandle next) Sets the next instruction handle.(package private) final InstructionHandleInstructionHandle.setPrev(InstructionHandle prev) Sets the previous instruction handle.voidLocalVariableGen.setStart(InstructionHandle start) Sets the start instruction handle.voidCodeExceptionGen.setStartPC(InstructionHandle startPc) Sets start of handler.voidBranchHandle.setTarget(InstructionHandle ih) Pass new target to instruction.voidBranchInstruction.setTarget(InstructionHandle target) Sets branch target.voidSelect.setTarget(int i, InstructionHandle target) Sets branch target for 'i'th case.(package private) final voidSelect.setTargets(InstructionHandle[] array) private static voidSWITCH.sort(int l, int r, int[] match, InstructionHandle[] targets) Sorts match and targets array with QuickSort.voidBranchHandle.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) Update target of instruction.voidBranchInstruction.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) voidCodeExceptionGen.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) voidInstructionTargeter.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) Replaces the target of this targeter from this old handle to the new handle.voidLineNumberGen.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) voidLocalVariableGen.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) voidSelect.updateTarget(InstructionHandle oldIh, InstructionHandle newIh) private MethodGen.BranchTargetMethodGen.BranchStack.visit(InstructionHandle target, int stackDepth) private booleanMethodGen.BranchStack.visited(InstructionHandle target) Constructors in org.apache.bcel.generic with parameters of type InstructionHandleModifierConstructorDescriptionprotectedBranchInstruction(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, that is, specify region where a handler is active and an instruction where the actual handling is done.GOTO(InstructionHandle target) Constructs a GOTO instruction.GOTO_W(InstructionHandle target) Constructs a GOTO_W instruction.(package private)GotoInstruction(short opcode, InstructionHandle target) IF_ACMPEQ(InstructionHandle target) Constructs an IF_ACMPEQ instruction.IF_ACMPNE(InstructionHandle target) Constructs an IF_ACMPNE instruction.IF_ICMPEQ(InstructionHandle target) Constructs an IF_ICMPEQ instruction.IF_ICMPGE(InstructionHandle target) Constructs an IF_ICMPGE instruction.IF_ICMPGT(InstructionHandle target) Constructs an IF_ICMPGT instruction.IF_ICMPLE(InstructionHandle target) Constructs an IF_ICMPLE instruction.IF_ICMPLT(InstructionHandle target) Constructs an IF_ICMPLT instruction.IF_ICMPNE(InstructionHandle target) Constructs an IF_ICMPNE instruction.IFEQ(InstructionHandle target) Constructs an IFEQ instruction.IFGE(InstructionHandle target) Constructs an IFGE instruction.IFGT(InstructionHandle target) Constructs an IFGT instruction.protectedIfInstruction(short opcode, InstructionHandle target) Constructs an IfInstruction.IFLE(InstructionHandle target) Constructs an IFLE instruction.IFLT(InstructionHandle target) Constructs an IFLT instruction.IFNE(InstructionHandle target) Constructs an IFNE instruction.IFNONNULL(InstructionHandle target) Constructs an IFNONNULL instruction.IFNULL(InstructionHandle target) Constructs an IFNULL instruction.JSR(InstructionHandle target) Constructs a JSR instruction.JSR_W(InstructionHandle target) Constructs a JSR_W instruction.(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) Constructs a LOOKUPSWITCH instruction.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) Constructs a SWITCH with default maxGap of 1.SWITCH(int[] match, InstructionHandle[] targets, InstructionHandle target, int maxGap) Template for switch() constructs.TABLESWITCH(int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) Constructs a TABLESWITCH instruction.(package private)TargetLostException(InstructionHandle[] targets, String message) Constructs a TargetLostException. -
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.branchMapMethods 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 TypeMethodDescriptionbooleanInstructionFinder.CodeConstraint.checkCode(InstructionHandle[] match) Checks if the matched code area is really useful.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 InstructionHandleExceptionHandler.handlerPcThe InstructionHandle where the handling begins.private final InstructionHandleControlFlowGraph.InstructionContextImpl.instructionThe InstructionHandle this InstructionContext is wrapped around.private InstructionHandleSubroutines.SubroutineImpl.theRETThe 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.exceptionHandlersThe ExceptionHandler instances.private final Map<InstructionHandle,InstructionContext> ControlFlowGraph.instructionContextsAll InstructionContext instances of this ControlFlowGraph.private final Set<InstructionHandle>Subroutines.SubroutineImpl.instructionsThe instructions that belong to this subroutine.private final Map<InstructionHandle,Subroutine> Subroutines.subroutinesThe map containing the subroutines found.private final Set<InstructionHandle>Subroutines.SubroutineImpl.theJSRsThe 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 TypeMethodDescriptionvoidSubroutines.SubroutineImpl.addEnteringJsrInstruction(InstructionHandle jsrInst) Adds a new JSR or JSR_W that has this subroutine as its target.(package private) voidSubroutines.SubroutineImpl.addInstruction(InstructionHandle ih) booleanSubroutine.contains(InstructionHandle inst) Returns if the given InstructionHandle refers to an instruction that is part of this subroutine.booleanSubroutines.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.booleanControlFlowGraph.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.(package private)Creates an InstructionHandleImpl object from an InstructionHandle.