ART: API to dex instructions
- Added the GetConstant function call in DecodedInstruction.
- Added a few rewriter helper functions for later higher level rewriting.
- Added Setter/Getter data and query functions.
- Added Clobber memory/Const/Call/Cast data and query functions.
- Added expression information (add, multiply, ...).
- Added a IsLinear function for additions and subtractions.
- Added an empty constructor for the DecodedInstruction:
- Useful for the creation of a MIR constructor too.
- Added the IsConditionalBranch utility function.
Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Signed-off-by: Yixin Shou <yixin.shou@intel.com>
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Signed-off-by: Udayan Banerji <udayan.banerji@intel.com>
Change-Id: Ie21f2a7779b38c1b383334f04126c2d792cae462
diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h
index 560e5ff..1ff5c19 100644
--- a/runtime/dex_instruction.h
+++ b/runtime/dex_instruction.h
@@ -118,13 +118,30 @@
};
enum Flags {
- kBranch = 0x01, // conditional or unconditional branch
- kContinue = 0x02, // flow can continue to next statement
- kSwitch = 0x04, // switch statement
- kThrow = 0x08, // could cause an exception to be thrown
- kReturn = 0x10, // returns, no additional statements
- kInvoke = 0x20, // a flavor of invoke
- kUnconditional = 0x40, // unconditional branch
+ kBranch = 0x000001, // conditional or unconditional branch
+ kContinue = 0x000002, // flow can continue to next statement
+ kSwitch = 0x000004, // switch statement
+ kThrow = 0x000008, // could cause an exception to be thrown
+ kReturn = 0x000010, // returns, no additional statements
+ kInvoke = 0x000020, // a flavor of invoke
+ kUnconditional = 0x000040, // unconditional branch
+ kAdd = 0x000080, // addition
+ kSubtract = 0x000100, // subtract
+ kMultiply = 0x000200, // multiply
+ kDivide = 0x000400, // division
+ kRemainder = 0x000800, // remainder
+ kAnd = 0x001000, // and
+ kOr = 0x002000, // or
+ kXor = 0x004000, // xor
+ kShl = 0x008000, // shl
+ kShr = 0x010000, // shr
+ kUshr = 0x020000, // ushr
+ kCast = 0x040000, // cast
+ kStore = 0x080000, // store opcode
+ kLoad = 0x100000, // load opcode
+ kClobber = 0x200000, // clobbers memory in a big way (not just a write)
+ kRegCFieldOrConstant = 0x400000, // is the third virtual register a field or literal constant (vC)
+ kRegBFieldOrConstant = 0x800000, // is the second virtual register a field or literal constant (vB)
};
enum VerifyFlag {