|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdovs.instructions.Instruction
public abstract class Instruction
Base class for all instruction classes. Some instruction classes correspond to one of a number of different actual JVM instructions, depending on the values of its parameters.
| Field Summary | |
|---|---|
private int |
id
An identification number associated with the instruction type. |
private static Map<Class<? extends Instruction>,Integer> |
inst_id
|
private static int |
next_id
|
| Constructor Summary | |
|---|---|
Instruction()
|
|
| Method Summary | |
|---|---|
boolean |
canFallThrough()
Can this instruction transfer control to the succeeding instruction? |
boolean |
canJump()
Can this instruction transfer control to a label? |
Object |
getArg(int i)
Returns the specified numbered argument as given to the constructor. |
int |
getID()
Returns an identification number associated with the instruction type. |
static int |
getID(Class<? extends Instruction> c)
Returns an identification number associated with the instruction type. |
Label |
getTarget()
What is the target of any jump that this instruction performs? |
int |
localAccess()
Returns the index of the highest numbered local variable accessed by this instruction. |
abstract int |
stackChange()
Returns the number of stack slots that the stack height will change when this instruction is executed. |
abstract String |
toAsm()
Returns the instruction in jasmin format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int id
getID()private static Map<Class<? extends Instruction>,Integer> inst_id
private static int next_id
| Constructor Detail |
|---|
public Instruction()
| Method Detail |
|---|
public final int getID()
public static int getID(Class<? extends Instruction> c)
c - the instruction class to get the ID forpublic abstract String toAsm()
jasmin format.
public abstract int stackChange()
public int localAccess()
public boolean canJump()
getTarget() method returns the label.
public boolean canFallThrough()
public Label getTarget()
canJump() returns
true.
public Object getArg(int i)
i - the index of the argument.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||