joeq.Compiler.BytecodeAnalysis
Class Bytecodes.Select
java.lang.Object
joeq.Compiler.BytecodeAnalysis.Bytecodes.Instruction
joeq.Compiler.BytecodeAnalysis.Bytecodes.BranchInstruction
joeq.Compiler.BytecodeAnalysis.Bytecodes.Select
- All Implemented Interfaces:
- Serializable, Cloneable, Bytecodes.InstructionTargeter, Bytecodes.StackProducer, Bytecodes.VariableLengthInstruction
- Direct Known Subclasses:
- Bytecodes.LOOKUPSWITCH, Bytecodes.TABLESWITCH
- Enclosing interface:
- Bytecodes
public abstract static class Bytecodes.Select
- extends Bytecodes.BranchInstruction
- implements Bytecodes.VariableLengthInstruction, Bytecodes.StackProducer
- See Also:
- Serialized Form
match
protected int[] match
indices
protected int[] indices
targets
protected ArrayList targets
fixed_length
protected int fixed_length
match_length
protected int match_length
padding
protected int padding
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
- Parameters:
offset
- additional offset caused by preceding (variable length) instructionsmax_offset
- the maximum offset that may be caused by these instructions
- Returns:
- additional offset caused by possible change of this instruction's length
dump
public void dump(DataOutputStream out)
throws IOException
- Dump instruction as byte code to stream out.
- Overrides:
dump
in class Bytecodes.BranchInstruction
- Parameters:
out
- Output stream
- Throws:
IOException
initFromFile
protected void initFromFile(jq_ConstantPool cp,
jwutil.io.ByteSequence bytes,
boolean wide)
throws IOException
- Read needed data (e.g. index) from file.
- Overrides:
initFromFile
in class Bytecodes.BranchInstruction
- Parameters:
cp
- constant pool of class we are readingbytes
- input streamwide
- wide prefix?
- Throws:
IOException
- See Also:
Bytecodes.InstructionList
toString
public 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
- Parameters:
verbose
- long/short format switch
- Returns:
- mnemonic for instruction
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
- Parameters:
old_ih
- old targetnew_ih
- new target
containsTarget
public boolean containsTarget(Bytecodes.InstructionHandle ih)
- Specified by:
containsTarget
in interface Bytecodes.InstructionTargeter
- Overrides:
containsTarget
in class Bytecodes.BranchInstruction
- Returns:
- true, if ih is target of this instruction
getMatchs
public int[] getMatchs()
- Returns:
- array of match indices
getIndices
public int[] getIndices()
- Returns:
- array of match target offsets
getTargets
public List getTargets()
- Returns:
- array of match targets
Copyright © 2001-2008 John Whaley. All Rights Reserved.