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 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, 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 void dump(DataOutputStream out) throws IOException
dump
in class Instruction
out
- Output streamIOException
protected 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 String toString(boolean verbose)
toString
in class Instruction
verbose
- long/short format switchprotected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
initFromFile
in class Instruction
bytes
- input streamwide
- wide prefix?IOException
- may be thrown if the implementation needs to read data from the fileInstructionList
public final int getIndex()
public InstructionHandle getTarget()
public void setTarget(InstructionHandle target)
target
- branch targetpublic void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
InstructionTargeter
updateTarget
in interface InstructionTargeter
old_ih
- old targetnew_ih
- new targetpublic boolean containsTarget(InstructionHandle ih)
InstructionTargeter
containsTarget
in interface InstructionTargeter
protected int getPosition()
protected void setPosition(int position)
position
- the position to setprotected void setIndex(int index)
index
- the index to setCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.