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 |
|---|---|
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.
|
void |
dump(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.
|
protected void |
setIndex(int index) |
protected void |
setPosition(int position) |
void |
setTarget(InstructionHandle target)
Set branch target
|
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 maxOffset)
Called by InstructionList.setPositions when setting the position for every instruction.
|
void |
updateTarget(InstructionHandle oldIh,
InstructionHandle newIh)
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, toString, toString@Deprecated protected int index
@Deprecated protected InstructionHandle target
@Deprecated protected int position
protected BranchInstruction(short opcode, InstructionHandle target)
opcode - Instruction opcodetarget - instruction to branch topublic boolean containsTarget(InstructionHandle ih)
InstructionTargetercontainsTarget in interface InstructionTargeterpublic void dump(DataOutputStream out) throws IOException
dump in class Instructionout - Output streamIOExceptionpublic final int getIndex()
protected int getPosition()
public InstructionHandle getTarget()
protected int getTargetOffset()
protected int getTargetOffset(InstructionHandle target)
target - branch targetprotected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
initFromFile in class Instructionbytes - input streamwide - wide prefix?IOException - may be thrown if the implementation needs to read data from the fileInstructionListprotected void setIndex(int index)
index - the index to setprotected void setPosition(int position)
position - the position to setpublic void setTarget(InstructionHandle target)
target - branch targetpublic String toString(boolean verbose)
toString in class Instructionverbose - long/short format switchprotected int updatePosition(int offset, int maxOffset)
offset - additional offset caused by preceding (variable length) instructionsmaxOffset - the maximum offset that may be caused by these instructionspublic void updateTarget(InstructionHandle oldIh, InstructionHandle newIh)
InstructionTargeterupdateTarget in interface InstructionTargeteroldIh - old targetnewIh - new targetCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.