|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.classfile.AbstractInstructionAccessor
at.dms.classfile.Instruction
at.dms.classfile.SwitchInstruction
public class SwitchInstruction
Some instructions are perniticky enough that its simpler to write them separately instead of smushing them with all the rest. the multiarray instruction is one of them.
Field Summary |
---|
Constructor Summary | |
---|---|
SwitchInstruction(InstructionAccessor deflab,
int[] matches,
InstructionAccessor[] targets)
Constructs a switch instruction |
|
SwitchInstruction(InstructionAccessor deflab,
Vector<Integer> matches,
Vector targets)
Constructs a switch instruction |
|
SwitchInstruction(int opcode,
InstructionAccessor deflab,
int[] matches,
InstructionAccessor[] targets)
Constructs a switch instruction |
Method Summary | |
---|---|
boolean |
canComplete()
Returns true iff control flow can reach the next instruction in textual order. |
int |
getMatch(int position)
Returns the case's value at a position |
int |
getPushedOnStack()
Returns the size of data pushed on the stack by this instruction |
byte |
getReturnType()
Returns the type pushed on the stack |
int |
getStack()
Return the amount of stack (positive or negative) used by this instruction |
int |
getSwitchCount()
Gets the number of 'case' |
InstructionAccessor |
getTarget(int position)
Returns the target at a position |
void |
selectSwitchType()
Select the appropriate switch type (tableswitch or lookupswitch) |
void |
setTarget(InstructionAccessor target,
int position)
Sets the target for this instruction |
void |
setTarget(int position,
InstructionAccessor accessor)
Returns the target at a position |
void |
transformAccessors(AccessorTransformer transformer)
Transforms targets (deferences to actual instructions). |
Methods inherited from class at.dms.classfile.Instruction |
---|
dump, getOpcode, getPoppedFromStack, isLiteral |
Methods inherited from class at.dms.classfile.AbstractInstructionAccessor |
---|
deepClone, deepCloneInto, transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwitchInstruction(int opcode, InstructionAccessor deflab, int[] matches, InstructionAccessor[] targets)
opcode
- the opcode of the instructiondeflab
- default target for switchmatches
- array of match values to compare the key totargets
- array of target instructions for each match valuepublic SwitchInstruction(InstructionAccessor deflab, int[] matches, InstructionAccessor[] targets)
deflab
- default target for switchmatches
- array of match values to compare the key totargets
- array of target instructions for each match valuepublic SwitchInstruction(InstructionAccessor deflab, Vector<Integer> matches, Vector targets)
deflab
- default target for switchmatches
- vector of match values to compare the key totargets
- vector of target instructions for each match valueMethod Detail |
---|
public boolean canComplete()
canComplete
in class Instruction
public void transformAccessors(AccessorTransformer transformer) throws BadAccessorException
transformAccessors
in interface AccessorContainer
transformer
- the transformer used to transform accessors
BadAccessorException
public void setTarget(InstructionAccessor target, int position)
public int getSwitchCount()
public int getMatch(int position)
public InstructionAccessor getTarget(int position)
public void setTarget(int position, InstructionAccessor accessor)
public void selectSwitchType()
public byte getReturnType()
getReturnType
in class Instruction
public int getPushedOnStack()
getPushedOnStack
in class Instruction
public int getStack()
getStack
in class Instruction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |