java.lang.Object
Compil3r.BytecodeAnalysis.Bytecodes.Instruction
Compil3r.BytecodeAnalysis.Bytecodes.BranchInstruction
Compil3r.BytecodeAnalysis.Bytecodes.Select
- All Implemented Interfaces:
- Bytecodes.InstructionTargeter, Bytecodes.StackProducer, Bytecodes.VariableLengthInstruction, java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- Bytecodes.LOOKUPSWITCH, Bytecodes.TABLESWITCH
- Enclosing class:
- Bytecodes
- public abstract static class Bytecodes.Select
- extends Bytecodes.BranchInstruction
- implements Bytecodes.VariableLengthInstruction, Bytecodes.StackProducer
match
protected int[] match
indices
protected int[] indices
targets
protected java.util.ArrayList targets
fixed_length
protected int fixed_length
match_length
protected int match_length
padding
protected int padding
Bytecodes.Select
Bytecodes.Select()
- Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
Bytecodes.Select
Bytecodes.Select(short opcode,
int[] match,
java.util.ArrayList targets,
Bytecodes.InstructionHandle target)
- (Match, target) pairs for switch.
`Match' and `targets' must have the same length of course.
updatePosition
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.
Called by InstructionList.setPositions when setting the position for every
instruction. In the presence of variable length instructions `setPositions'
performs multiple passes over the instruction list to calculate the
correct (byte) positions and offsets by calling this function.
- Overrides:
updatePosition in class Bytecodes.BranchInstruction
dump
public void dump(java.io.DataOutputStream out)
throws java.io.IOException
- Dump instruction as byte code to stream out.
- Overrides:
dump in class Bytecodes.BranchInstruction
initFromFile
protected void initFromFile(Clazz.jq_ConstantPool cp,
Util.IO.ByteSequence bytes,
boolean wide)
throws java.io.IOException
- Read needed data (e.g. index) from file.
- Overrides:
initFromFile in class Bytecodes.BranchInstruction
toString
public java.lang.String toString(boolean verbose)
- Description copied from class:
Bytecodes.BranchInstruction
- Long output format:
<position in byte code>
<name of opcode> "["<opcode number>"]"
"("<length of instruction>")"
"<"<target instruction>">" "@"<branch target offset>
- Overrides:
toString in class Bytecodes.BranchInstruction
setTarget
public void setTarget(int i,
Bytecodes.InstructionHandle target)
- Set branch target for `i'th case
updateTarget
public void updateTarget(Bytecodes.InstructionHandle old_ih,
Bytecodes.InstructionHandle new_ih)
- Specified by:
updateTarget in interface Bytecodes.InstructionTargeter- Overrides:
updateTarget in class Bytecodes.BranchInstruction
containsTarget
public boolean containsTarget(Bytecodes.InstructionHandle ih)
- Specified by:
containsTarget in interface Bytecodes.InstructionTargeter- Overrides:
containsTarget in class Bytecodes.BranchInstruction
dispose
void dispose()
- Inform targets that they're not targeted anymore.
- Overrides:
dispose in class Bytecodes.BranchInstruction
getMatchs
public int[] getMatchs()
getIndices
public int[] getIndices()
getTargets
public java.util.List getTargets()