public abstract class SwitchInstruction extends JumpInstruction
Constructor and Description |
---|
SwitchInstruction(Code owner,
int opcode) |
Modifier and Type | Method and Description |
---|---|
SwitchInstruction |
addCase(int match,
Instruction target)
Add a case to this switch.
|
abstract SwitchInstruction |
addMatch(int match) |
SwitchInstruction |
addTarget(Instruction target)
Add a target to this switch.
|
int |
countTargets() |
int |
getDefaultOffset()
Synonymous with
JumpInstruction.getOffset() . |
Instruction |
getDefaultTarget()
Synonymous with
JumpInstruction.getTarget() . |
abstract int[] |
getMatches() |
int[] |
getOffsets()
Returns the current byte offsets for the different
switch cases in this Instruction.
|
int |
getStackChange()
Return the number of stack positions this instruction pushes
or pops during its execution.
|
Instruction[] |
getTargets()
Return the targets for this switch, or empty array if not set.
|
void |
replaceTarget(Instruction oldTarget,
Instruction newTarget)
Replace the given old, likely invalid, target with a new target.
|
SwitchInstruction |
setCases(int[] matches,
Instruction[] targets)
Set the match-jumppt pairs for this switch.
|
SwitchInstruction |
setDefaultOffset(int offset)
Synonymous with
JumpInstruction.setOffset(int) . |
SwitchInstruction |
setDefaultTarget(Instruction ins)
Synonymous with
JumpInstruction.setTarget(serp.bytecode.Instruction) . |
SwitchInstruction |
setMatches(int[] matches) |
void |
setOffsets(int[] offsets)
Sets the offsets for the instructions representing the different
switch statement cases.
|
SwitchInstruction |
setTargets(Instruction[] targets)
Set the jump points for this switch.
|
void |
updateTargets()
Use the byte indexes read from the class file to calculate and
set references to the target instruction(s) for this ptr.
|
acceptVisit, equalsInstruction, getOffset, getTarget, setOffset, setTarget
getByteIndex, getClassLoader, getCode, getLineNumber, getLogicalStackChange, getName, getOpcode, getPool, getProject, isValid
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCode
public SwitchInstruction(Code owner, int opcode)
public int[] getOffsets()
public void setOffsets(int[] offsets)
public int countTargets()
public Instruction getDefaultTarget()
JumpInstruction.getTarget()
.public int getDefaultOffset()
JumpInstruction.getOffset()
.public SwitchInstruction setDefaultOffset(int offset)
JumpInstruction.setOffset(int)
.public SwitchInstruction setDefaultTarget(Instruction ins)
JumpInstruction.setTarget(serp.bytecode.Instruction)
.public Instruction[] getTargets()
public SwitchInstruction setTargets(Instruction[] targets)
public SwitchInstruction addTarget(Instruction target)
public int getStackChange()
Instruction
getStackChange
in class Instruction
public void updateTargets()
InstructionPtr
updateTargets
in interface InstructionPtr
updateTargets
in class JumpInstruction
public void replaceTarget(Instruction oldTarget, Instruction newTarget)
InstructionPtr
replaceTarget
in interface InstructionPtr
replaceTarget
in class JumpInstruction
public SwitchInstruction setCases(int[] matches, Instruction[] targets)
public SwitchInstruction setMatches(int[] matches)
public SwitchInstruction addCase(int match, Instruction target)
public abstract SwitchInstruction addMatch(int match)
public abstract int[] getMatches()
Copyright © 2002–2019. All rights reserved.