|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aspectj.apache.bcel.generic.Instruction org.aspectj.apache.bcel.generic.InstructionBranch
public class InstructionBranch
Abstract super class for branching instructions like GOTO, IFEQ, etc.. Branch instructions may have a variable length, namely GOTO, JSR, LOOKUPSWITCH and TABLESWITCH. A branch instruction may be talking in terms of absolute destination (targetIndex) or about an instruction it doesnt yet know the position if (targetInstruction). targetInstruction (if set) overrides targetIndex
InstructionList
,
Serialized FormField Summary | |
---|---|
protected int |
positionOfThisInstruction
|
protected int |
targetIndex
|
protected InstructionHandle |
targetInstruction
|
Fields inherited from class org.aspectj.apache.bcel.generic.Instruction |
---|
opcode |
Constructor Summary | |
---|---|
InstructionBranch(short opcode)
|
|
InstructionBranch(short opcode,
InstructionHandle target)
|
|
InstructionBranch(short opcode,
int index)
|
Method Summary | |
---|---|
boolean |
containsTarget(InstructionHandle ih)
|
void |
dump(java.io.DataOutputStream out)
|
boolean |
equals(java.lang.Object other)
Only equal if they are the same branch instruction - otherwise too risky as the targets may only temporarily be pointing at the same destination. |
int |
getIndex()
|
InstructionHandle |
getTarget()
|
protected int |
getTargetOffset()
|
Type |
getType(ConstantPool cp)
|
int |
hashCode()
|
boolean |
isIfInstruction()
|
InstructionHandle |
physicalSuccessor()
Returns an InstructionHandle to the physical successor of this JsrInstruction. |
void |
setTarget(InstructionHandle target)
Set branch target |
java.lang.String |
toString(boolean verbose)
Long output format: |
protected int |
updatePosition(int offset,
int max_offset)
Called by InstructionList.setPositions when setting the position for every instruction. |
void |
updateTarget(InstructionHandle oldHandle,
InstructionHandle newHandle)
Update the target destination for this instruction. |
Methods inherited from class org.aspectj.apache.bcel.generic.Instruction |
---|
consumeStack, copy, getLength, getLoadClassType, getName, getOpcode, getType, getValue, getValue, isALOAD, isArrayCreationInstruction, isASTORE, isConstantInstruction, isConstantPoolInstruction, isIndexedInstruction, isJsrInstruction, isLoadInstruction, isLocalVariableInstruction, isReturnInstruction, isStackConsumer, isStackProducer, isStoreInstruction, produceStack, readInstruction, setIndex, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int targetIndex
protected InstructionHandle targetInstruction
protected int positionOfThisInstruction
Constructor Detail |
---|
public InstructionBranch(short opcode, InstructionHandle target)
public InstructionBranch(short opcode, int index)
public InstructionBranch(short opcode)
Method Detail |
---|
public void dump(java.io.DataOutputStream out) throws java.io.IOException
dump
in class Instruction
java.io.IOException
protected int getTargetOffset()
protected int updatePosition(int offset, int max_offset)
offset
- additional offset caused by preceding (variable length) instructionsmax_offset
- the maximum offset that may be caused by these instructions
public java.lang.String toString(boolean verbose)
toString
in class Instruction
verbose
- long/short format switch
public final int getIndex()
getIndex
in class Instruction
public InstructionHandle getTarget()
public void setTarget(InstructionHandle target)
target
- branch targetpublic void updateTarget(InstructionHandle oldHandle, InstructionHandle newHandle)
updateTarget
in interface InstructionTargeter
oldHandle
- old targetnewHandle
- new targetpublic boolean containsTarget(InstructionHandle ih)
containsTarget
in interface InstructionTargeter
public Type getType(ConstantPool cp)
getType
in class Instruction
public InstructionHandle physicalSuccessor()
public boolean isIfInstruction()
public boolean equals(java.lang.Object other)
equals
in class Instruction
public int hashCode()
hashCode
in class Instruction
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |