summaryrefslogtreecommitdiffstats
path: root/libdex/OpCode.h
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2010-06-17 12:36:00 -0700
committerAndy McFadden <fadden@android.com>2010-06-18 12:43:08 -0700
commitc35a2ef53d0cccd6f924eeba36633220ec67c32e (patch)
tree3dca5c629067edc9f6968d11b91621198de18387 /libdex/OpCode.h
parent54c91f8f33fc12d741aaa0dcdb375991e252c994 (diff)
downloadandroid_dalvik-c35a2ef53d0cccd6f924eeba36633220ec67c32e.tar.gz
android_dalvik-c35a2ef53d0cccd6f924eeba36633220ec67c32e.tar.bz2
android_dalvik-c35a2ef53d0cccd6f924eeba36633220ec67c32e.zip
Add opcodes for volatile field accesses
This adds instructions for {i,s}{get,put}{,-object}-volatile, for a total of eight new instructions. On SMP systems, these instructions will be substituted in for existing field access instructions, either by dexopt or during just-in-time verification. Unlike the wide-volatile instructions, these will not be used at all when the VM is not built for SMP. (Ideally we'd omit the volatile instruction implementations entirely on non-SMP builds, but that requires a little work in gen-mterp.py.) The change defines and implements the opcodes and support methods, but does not cause them to be used. Also, changed dvmQuasiAtomicRead64's argument to be const. Change-Id: I9e44fe881e87f27aa41f6c6e898ec4402cb5493e
Diffstat (limited to 'libdex/OpCode.h')
-rw-r--r--libdex/OpCode.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/libdex/OpCode.h b/libdex/OpCode.h
index f0bc423b4..312ff0175 100644
--- a/libdex/OpCode.h
+++ b/libdex/OpCode.h
@@ -321,13 +321,13 @@ typedef enum OpCode {
OP_SHR_INT_LIT8 = 0xe1,
OP_USHR_INT_LIT8 = 0xe2,
- OP_UNUSED_E3 = 0xe3,
- OP_UNUSED_E4 = 0xe4,
- OP_UNUSED_E5 = 0xe5,
- OP_UNUSED_E6 = 0xe6,
- OP_UNUSED_E7 = 0xe7,
-
/* verifier/optimizer output -- nothing below here is generated by "dx" */
+ OP_IGET_VOLATILE = 0xe3,
+ OP_IPUT_VOLATILE = 0xe4,
+ OP_SGET_VOLATILE = 0xe5,
+ OP_SPUT_VOLATILE = 0xe6,
+ OP_IGET_OBJECT_VOLATILE = 0xe7,
+
OP_IGET_WIDE_VOLATILE = 0xe8,
OP_IPUT_WIDE_VOLATILE = 0xe9,
OP_SGET_WIDE_VOLATILE = 0xea,
@@ -359,10 +359,11 @@ typedef enum OpCode {
OP_INVOKE_VIRTUAL_QUICK_RANGE = 0xf9,
OP_INVOKE_SUPER_QUICK = 0xfa,
OP_INVOKE_SUPER_QUICK_RANGE = 0xfb,
- OP_UNUSED_FC = 0xfc, /* OP_INVOKE_DIRECT_QUICK? */
- OP_UNUSED_FD = 0xfd, /* OP_INVOKE_DIRECT_QUICK_RANGE? */
- OP_UNUSED_FE = 0xfe, /* OP_INVOKE_INTERFACE_QUICK? */
- OP_UNUSED_FF = 0xff, /* OP_INVOKE_INTERFACE_QUICK_RANGE*/
+ OP_IPUT_OBJECT_VOLATILE = 0xfc,
+ OP_SGET_OBJECT_VOLATILE = 0xfd,
+ OP_SPUT_OBJECT_VOLATILE = 0xfe,
+
+ OP_UNUSED_FF = 0xff, /* reserved for code expansion */
} OpCode;
#define kNumDalvikInstructions 256
@@ -628,11 +629,11 @@ typedef enum OpCode {
H(OP_SHL_INT_LIT8), \
H(OP_SHR_INT_LIT8), \
H(OP_USHR_INT_LIT8), \
- H(OP_UNUSED_E3), \
- H(OP_UNUSED_E4), \
- H(OP_UNUSED_E5), \
- H(OP_UNUSED_E6), \
- H(OP_UNUSED_E7), \
+ H(OP_IGET_VOLATILE), \
+ H(OP_IPUT_VOLATILE), \
+ H(OP_SGET_VOLATILE), \
+ H(OP_SPUT_VOLATILE), \
+ H(OP_IGET_OBJECT_VOLATILE), \
H(OP_IGET_WIDE_VOLATILE), \
H(OP_IPUT_WIDE_VOLATILE), \
H(OP_SGET_WIDE_VOLATILE), \
@@ -654,9 +655,9 @@ typedef enum OpCode {
H(OP_INVOKE_VIRTUAL_QUICK_RANGE), \
H(OP_INVOKE_SUPER_QUICK), \
H(OP_INVOKE_SUPER_QUICK_RANGE), \
- H(OP_UNUSED_FC), \
- H(OP_UNUSED_FD), \
- H(OP_UNUSED_FE), \
+ H(OP_IPUT_OBJECT_VOLATILE), \
+ H(OP_SGET_OBJECT_VOLATILE), \
+ H(OP_SPUT_OBJECT_VOLATILE), \
H(OP_UNUSED_FF), \
};