Package com.android.dx.cf.code
Class Simulator
java.lang.Object
com.android.dx.cf.code.Simulator
Class which knows how to simulate the effects of executing bytecode.
Note: This class is not thread-safe. If multiple threads need to use a single instance, they must synchronize access explicitly between themselves.
-
Constructor Summary
ConstructorDescriptionSimulator
(Machine machine, ConcreteMethod method, DexOptions dexOptions) Constructs an instance. -
Method Summary
-
Constructor Details
-
Simulator
Constructs an instance.- Parameters:
machine
-non-null;
machine to use when simulatingmethod
-non-null;
method data to usedexOptions
-non-null;
options for dex output
-
-
Method Details
-
simulate
Simulates the effect of executing the given basic block. This modifies the passed-in frame to represent the end result.- Parameters:
bb
-non-null;
the basic blockframe
-non-null;
frame to operate on
-
simulate
Simulates the effect of the instruction at the given offset, by making appropriate calls on the given frame.- Parameters:
offset
-offset >= 0;
offset of the instruction to simulateframe
-non-null;
frame to operate on- Returns:
- the length of the instruction, in bytes
-