|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Machine
Interface for machines capable of executing bytecode by acting
upon a Frame. A machine conceptually contains four arbitrary-value
argument slots, slots for several literal-value arguments, and slots for
branch target information.
| Method Summary | |
|---|---|
void |
auxCstArg(Constant cst)
Indicates that there is an auxiliary (inline, not stack) object argument, with the value based on the given constant. |
void |
auxInitValues(ArrayList<Constant> initValues)
Indicates that there is an auxiliary (inline, not stack) argument consisting of a list of initial values for a newly created array. |
void |
auxIntArg(int value)
Indicates that there is an auxiliary (inline, not stack) argument of type int, with the given value. |
void |
auxSwitchArg(SwitchList cases)
Indicates that there is an auxiliary (inline, not stack) argument consisting of a switch* table. |
void |
auxTargetArg(int target)
Indicates that there is an auxiliary (inline, not stack) argument indicating a branch target. |
void |
auxType(Type type)
Indicates that the salient type of this operation is as given. |
void |
clearArgs()
Clears the regular and auxiliary arguments area. |
Prototype |
getPrototype()
Gets the effective prototype of the method that this instance is being used for. |
void |
localArg(Frame frame,
int idx)
Loads the local variable with the given index as the sole argument in the arguments area. |
void |
localInfo(boolean local)
Used to specify if a loaded local variable has info in the local variable table. |
void |
localTarget(int idx,
Type type,
LocalItem local)
Indicates that the target of this operation is the given local. |
void |
popArgs(Frame frame,
int count)
Pops the given number of values from the stack (of either category), and store them in the arguments area, indicating that there are now that many arguments. |
void |
popArgs(Frame frame,
Prototype prototype)
Pops values from the stack of the types indicated by the given Prototype (popped in reverse of the argument
order, so the first prototype argument type is for the deepest
element of the stack), and store them in the arguments area,
indicating that there are now that many arguments. |
void |
popArgs(Frame frame,
Type type)
Pops a value from the stack of the indicated type, and store it in the arguments area, indicating that there are now that many arguments. |
void |
popArgs(Frame frame,
Type type1,
Type type2)
Pops values from the stack of the indicated types (popped in reverse argument order, so the first indicated type is for the deepest element of the stack), and store them in the arguments area, indicating that there are now that many arguments. |
void |
popArgs(Frame frame,
Type type1,
Type type2,
Type type3)
Pops values from the stack of the indicated types (popped in reverse argument order, so the first indicated type is for the deepest element of the stack), and store them in the arguments area, indicating that there are now that many arguments. |
void |
run(Frame frame,
int offset,
int opcode)
"Runs" the indicated opcode in an appropriate way, using the arguments area as appropriate, and modifying the given frame in response. |
| Method Detail |
|---|
Prototype getPrototype()
this argument for instance methods.
non-null; the method prototypevoid clearArgs()
void popArgs(Frame frame,
int count)
frame - non-null; frame to operate oncount - >= 0; number of values to pop
void popArgs(Frame frame,
Prototype prototype)
Prototype (popped in reverse of the argument
order, so the first prototype argument type is for the deepest
element of the stack), and store them in the arguments area,
indicating that there are now that many arguments. Also, clear
the auxiliary arguments.
frame - non-null; frame to operate onprototype - non-null; prototype indicating arguments to pop
void popArgs(Frame frame,
Type type)
frame - non-null; frame to operate ontype - non-null; type of the argument
void popArgs(Frame frame,
Type type1,
Type type2)
frame - non-null; frame to operate ontype1 - non-null; type of the first argumenttype2 - non-null; type of the second argument
void popArgs(Frame frame,
Type type1,
Type type2,
Type type3)
frame - non-null; frame to operate ontype1 - non-null; type of the first argumenttype2 - non-null; type of the second argumenttype3 - non-null; type of the third argument
void localArg(Frame frame,
int idx)
frame - non-null; frame to operate onidx - >= 0; the local variable indexvoid localInfo(boolean local)
local - true if local arg has info in local variable tablevoid auxType(Type type)
Machine are collapsed to the int
variant. (See BytecodeArray.parseInstruction(int, com.android.dx.cf.code.BytecodeArray.Visitor) for
details.)
type - non-null; the salient type of the upcoming operationvoid auxIntArg(int value)
int, with the given value.
Note: Perhaps unintuitively, the stack manipulation
ops (e.g., dup and swap) use this to
indicate the result stack pattern with a straightforward hex
encoding of the push order starting with least-significant
nibbles getting pushed first). For example, an all-category-1
dup2_x1 sets this to 0x12312, and the
other form of that op sets this to
0x121.
Also Note: For switch* instructions, this is
used to indicate the padding value (which is only useful for
verification).
value - the argument valuevoid auxCstArg(Constant cst)
Note: Some opcodes use both int and
constant auxiliary arguments.
cst - non-null; the constant containing / referencing
the valuevoid auxTargetArg(int target)
target - the argument valuevoid auxSwitchArg(SwitchList cases)
switch* table.
Note: This is generally used in conjunction with
auxIntArg(int) (which holds the padding).
cases - non-null; the list of key-target pairs, plus the default
targetvoid auxInitValues(ArrayList<Constant> initValues)
initValues - non-null; the list of constant values to initialize
the array
void localTarget(int idx,
Type type,
LocalItem local)
idx - >= 0; the local variable indextype - non-null; the type of the locallocal - null-ok; the name and signature of the local, if known
void run(Frame frame,
int offset,
int opcode)
frame - non-null; frame to operate onoffset - >= 0; byte offset in the method to the opcode being
runopcode - >= 0; the opcode to run
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||