public abstract class BranchInstruction extends Instruction implements InstructionTargeter
InstructionList| Modifier and Type | Field and Description |
|---|---|
protected int |
index
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected int |
position
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected InstructionHandle |
target
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
length, opcode| Modifier | Constructor and Description |
|---|---|
(package private) |
BranchInstruction()
Empty constructor needed for Instruction.readInstruction.
|
protected |
BranchInstruction(short opcode,
InstructionHandle target)
Common super constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsTarget(InstructionHandle ih)
Checks whether this targeter targets the specified instruction handle.
|
(package private) void |
dispose()
Inform target that it's not targeted anymore.
|
void |
dump(java.io.DataOutputStream out)
Dump instruction as byte code to stream out.
|
int |
getIndex() |
protected int |
getPosition() |
InstructionHandle |
getTarget() |
protected int |
getTargetOffset() |
protected int |
getTargetOffset(InstructionHandle _target) |
protected void |
initFromFile(ByteSequence bytes,
boolean wide)
Read needed data (e.g.
|
(package private) static void |
notifyTarget(InstructionHandle old_ih,
InstructionHandle new_ih,
InstructionTargeter t)
Used by BranchInstruction, LocalVariableGen, CodeExceptionGen, LineNumberGen
|
protected void |
setIndex(int index) |
protected void |
setPosition(int position) |
void |
setTarget(InstructionHandle target)
Set branch target
|
java.lang.String |
toString(boolean verbose)
Long output format:
<position in byte code>
<name of opcode> "["<opcode number>"]"
"("<length of instruction>")"
"<"<target instruction>">" "@"<branch target offset>
|
protected int |
updatePosition(int offset,
int max_offset)
Called by InstructionList.setPositions when setting the position for every
instruction.
|
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
Replaces the target of this targeter from this old handle to the new handle.
|
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, setLength, setOpcode, toString, toString@Deprecated protected int index
@Deprecated protected InstructionHandle target
@Deprecated protected int position
BranchInstruction()
protected BranchInstruction(short opcode,
InstructionHandle target)
opcode - Instruction opcodetarget - instruction to branch topublic void dump(java.io.DataOutputStream out)
throws java.io.IOException
dump in class Instructionout - Output streamjava.io.IOExceptionprotected int getTargetOffset(InstructionHandle _target)
_target - branch targetprotected 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 instructionspublic java.lang.String toString(boolean verbose)
toString in class Instructionverbose - long/short format switchprotected void initFromFile(ByteSequence bytes, boolean wide) throws java.io.IOException
initFromFile in class Instructionbytes - input streamwide - wide prefix?java.io.IOException - may be thrown if the implementation needs to read data from the fileInstructionListpublic final int getIndex()
public InstructionHandle getTarget()
public void setTarget(InstructionHandle target)
target - branch targetstatic void notifyTarget(InstructionHandle old_ih, InstructionHandle new_ih, InstructionTargeter t)
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
InstructionTargeterupdateTarget in interface InstructionTargeterold_ih - old targetnew_ih - new targetpublic boolean containsTarget(InstructionHandle ih)
InstructionTargetercontainsTarget in interface InstructionTargetervoid dispose()
dispose in class Instructionprotected int getPosition()
protected void setPosition(int position)
position - the position to setprotected void setIndex(int index)
index - the index to set