public abstract class Select extends BranchInstruction implements VariableLengthInstruction, StackConsumer, StackProducer
We use our super's target property as the default target.
LOOKUPSWITCH,
TABLESWITCH,
InstructionList| Modifier and Type | Field and Description |
|---|---|
protected int |
fixed_length
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected int[] |
indices
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected int[] |
match
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected int |
match_length
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected int |
padding
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
protected InstructionHandle[] |
targets
Deprecated.
(since 6.0) will be made private; do not access directly, use getter/setter
|
index, position, targetlength, opcode| Constructor and Description |
|---|
Select()
Empty constructor needed for Instruction.readInstruction.
|
Select(short opcode,
int[] match,
InstructionHandle[] targets,
InstructionHandle defaultTarget)
(Match, target) pairs for switch.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
clone() |
boolean |
containsTarget(InstructionHandle ih)
Checks whether this targeter targets the specified instruction handle.
|
(package private) void |
dispose()
Inform targets that they're not targeted anymore.
|
void |
dump(java.io.DataOutputStream out)
Dump instruction as byte code to stream out.
|
(package private) int |
getFixed_length() |
int[] |
getIndices() |
(package private) int |
getIndices(int index) |
(package private) int |
getMatch_length() |
(package private) int |
getMatch(int index) |
int[] |
getMatchs() |
(package private) int |
getPadding() |
(package private) InstructionHandle |
getTarget(int index) |
InstructionHandle[] |
getTargets() |
protected void |
initFromFile(ByteSequence bytes,
boolean wide)
Read needed data (e.g.
|
(package private) void |
setFixed_length(int fixed_length) |
(package private) void |
setIndices(int[] array) |
(package private) int |
setIndices(int i,
int value) |
(package private) int |
setMatch_length(int match_length) |
(package private) void |
setMatch(int index,
int value) |
(package private) void |
setMatches(int[] array) |
void |
setTarget(int i,
InstructionHandle target)
Set branch target for `i'th case
|
(package private) void |
setTargets(InstructionHandle[] array) |
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)
Since this is a variable length instruction, it may shift the following
instructions which then need to update their position.
|
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
Replaces the target of this targeter from this old handle to the new handle.
|
getIndex, getPosition, getTarget, getTargetOffset, getTargetOffset, notifyTarget, setIndex, setPosition, setTargetaccept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, setLength, setOpcode, toString, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitconsumeStackproduceStack@Deprecated protected int[] match
@Deprecated protected int[] indices
@Deprecated protected InstructionHandle[] targets
@Deprecated protected int fixed_length
@Deprecated protected int match_length
@Deprecated protected int padding
Select()
Select(short opcode,
int[] match,
InstructionHandle[] targets,
InstructionHandle defaultTarget)
match - array of matching valuestargets - instruction targetsdefaultTarget - default instruction targetprotected int updatePosition(int offset,
int max_offset)
updatePosition in class BranchInstructionoffset - additional offset caused by preceding (variable length) instructionsmax_offset - the maximum offset that may be caused by these instructionspublic void dump(java.io.DataOutputStream out)
throws java.io.IOException
dump in class BranchInstructionout - Output streamjava.io.IOExceptionprotected void initFromFile(ByteSequence bytes, boolean wide) throws java.io.IOException
initFromFile in class BranchInstructionbytes - input streamwide - wide prefix?java.io.IOException - may be thrown if the implementation needs to read data from the fileInstructionListpublic java.lang.String toString(boolean verbose)
BranchInstructiontoString in class BranchInstructionverbose - long/short format switchpublic void setTarget(int i,
InstructionHandle target)
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
InstructionTargeterupdateTarget in interface InstructionTargeterupdateTarget in class BranchInstructionold_ih - old targetnew_ih - new targetpublic boolean containsTarget(InstructionHandle ih)
InstructionTargetercontainsTarget in interface InstructionTargetercontainsTarget in class BranchInstructionprotected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionvoid dispose()
dispose in class BranchInstructionpublic int[] getMatchs()
public int[] getIndices()
public InstructionHandle[] getTargets()
final int getMatch(int index)
final int getIndices(int index)
final InstructionHandle getTarget(int index)
final int getFixed_length()
final void setFixed_length(int fixed_length)
fixed_length - the fixed_length to setfinal int getMatch_length()
final int setMatch_length(int match_length)
match_length - the match_length to setfinal void setMatch(int index,
int value)
index - value - final void setIndices(int[] array)
array - final void setMatches(int[] array)
array - final void setTargets(InstructionHandle[] array)
array - final int getPadding()
final int setIndices(int i,
int value)