diff options
| author | Andy McFadden <fadden@android.com> | 2010-03-05 07:24:27 -0800 |
|---|---|---|
| committer | Andy McFadden <fadden@android.com> | 2010-03-05 12:07:05 -0800 |
| commit | 5387824f19033ed51a945fbc8c2b574998404b3d (patch) | |
| tree | d921096e958678d9b53295cd020011c85da8fd9d /libdex | |
| parent | 3fa53fd17aeb69685f91c32eb9d480d17503b7b4 (diff) | |
| download | android_dalvik-5387824f19033ed51a945fbc8c2b574998404b3d.tar.gz android_dalvik-5387824f19033ed51a945fbc8c2b574998404b3d.tar.bz2 android_dalvik-5387824f19033ed51a945fbc8c2b574998404b3d.zip | |
Add instructions for volatile wide fields.
This adds four new instructions for accessing volatile wide fields (long
and double). The JLS requires that such accesses are atomic, but the
VM doesn't otherwise make guarantees about the atomicity of reads and
writes on 64-bit fields.
There are no behavioral changes. This just adds definitions for the new
instructions and a couple of tests. The current implementation is just
the non-volatile form of the instructions or a C stub, but since we're
not generating them it doesn't really matter yet.
Also:
- bumped Dalvik version to 1.3.0
- added a note to the x86-atom TODO list
For bug 1633591.
Diffstat (limited to 'libdex')
| -rw-r--r-- | libdex/InstrUtils.c | 26 | ||||
| -rw-r--r-- | libdex/OpCode.h | 19 |
2 files changed, 24 insertions, 21 deletions
diff --git a/libdex/InstrUtils.c b/libdex/InstrUtils.c index d1ebeec16..05faf23ab 100644 --- a/libdex/InstrUtils.c +++ b/libdex/InstrUtils.c @@ -294,6 +294,10 @@ InstructionWidth* dexCreateInstrWidthTable(void) case OP_IPUT_QUICK: case OP_IPUT_WIDE_QUICK: case OP_IPUT_OBJECT_QUICK: + case OP_IGET_WIDE_VOLATILE: + case OP_IPUT_WIDE_VOLATILE: + case OP_SGET_WIDE_VOLATILE: + case OP_SPUT_WIDE_VOLATILE: case OP_THROW_VERIFICATION_ERROR: width = -2; break; @@ -322,10 +326,6 @@ InstructionWidth* dexCreateInstrWidthTable(void) case OP_UNUSED_E5: case OP_UNUSED_E6: case OP_UNUSED_E7: - case OP_UNUSED_E8: - case OP_UNUSED_E9: - case OP_UNUSED_EA: - case OP_UNUSED_EB: case OP_BREAKPOINT: case OP_UNUSED_F1: case OP_UNUSED_FC: @@ -625,6 +625,10 @@ InstructionFlags* dexCreateInstrFlagsTable(void) case OP_IPUT_QUICK: case OP_IPUT_WIDE_QUICK: case OP_IPUT_OBJECT_QUICK: + case OP_IGET_WIDE_VOLATILE: + case OP_IPUT_WIDE_VOLATILE: + case OP_SGET_WIDE_VOLATILE: + case OP_SPUT_WIDE_VOLATILE: flags = kInstrCanContinue | kInstrCanThrow; break; @@ -651,10 +655,6 @@ InstructionFlags* dexCreateInstrFlagsTable(void) case OP_UNUSED_E5: case OP_UNUSED_E6: case OP_UNUSED_E7: - case OP_UNUSED_E8: - case OP_UNUSED_E9: - case OP_UNUSED_EA: - case OP_UNUSED_EB: case OP_BREAKPOINT: case OP_UNUSED_F1: case OP_UNUSED_FC: @@ -966,6 +966,12 @@ InstructionFormat* dexCreateInstrFormatTable(void) case OP_THROW_VERIFICATION_ERROR: fmt = kFmt20bc; break; + case OP_IGET_WIDE_VOLATILE: + case OP_IPUT_WIDE_VOLATILE: + case OP_SGET_WIDE_VOLATILE: + case OP_SPUT_WIDE_VOLATILE: + fmt = kFmt22c; + break; case OP_IGET_QUICK: case OP_IGET_WIDE_QUICK: case OP_IGET_OBJECT_QUICK: @@ -1007,10 +1013,6 @@ InstructionFormat* dexCreateInstrFormatTable(void) case OP_UNUSED_E5: case OP_UNUSED_E6: case OP_UNUSED_E7: - case OP_UNUSED_E8: - case OP_UNUSED_E9: - case OP_UNUSED_EA: - case OP_UNUSED_EB: case OP_BREAKPOINT: case OP_UNUSED_F1: case OP_UNUSED_FC: diff --git a/libdex/OpCode.h b/libdex/OpCode.h index 58d17026b..4dfd0471c 100644 --- a/libdex/OpCode.h +++ b/libdex/OpCode.h @@ -326,10 +326,12 @@ typedef enum OpCode { OP_UNUSED_E5 = 0xe5, OP_UNUSED_E6 = 0xe6, OP_UNUSED_E7 = 0xe7, - OP_UNUSED_E8 = 0xe8, - OP_UNUSED_E9 = 0xe9, - OP_UNUSED_EA = 0xea, - OP_UNUSED_EB = 0xeb, + + /* verifier/optimizer output -- nothing below here is generated by "dx" */ + OP_IGET_WIDE_VOLATILE = 0xe8, + OP_IPUT_WIDE_VOLATILE = 0xe9, + OP_SGET_WIDE_VOLATILE = 0xea, + OP_SPUT_WIDE_VOLATILE = 0xeb, /* * The "breakpoint" instruction is special, in that it should never @@ -340,7 +342,6 @@ typedef enum OpCode { */ OP_BREAKPOINT = 0xec, - /* optimizer output -- these are never generated by "dx" */ OP_THROW_VERIFICATION_ERROR = 0xed, OP_EXECUTE_INLINE = 0xee, OP_EXECUTE_INLINE_RANGE = 0xef, @@ -632,10 +633,10 @@ typedef enum OpCode { H(OP_UNUSED_E5), \ H(OP_UNUSED_E6), \ H(OP_UNUSED_E7), \ - H(OP_UNUSED_E8), \ - H(OP_UNUSED_E9), \ - H(OP_UNUSED_EA), \ - H(OP_UNUSED_EB), \ + H(OP_IGET_WIDE_VOLATILE), \ + H(OP_IPUT_WIDE_VOLATILE), \ + H(OP_SGET_WIDE_VOLATILE), \ + H(OP_SPUT_WIDE_VOLATILE), \ H(OP_BREAKPOINT), \ H(OP_THROW_VERIFICATION_ERROR), \ H(OP_EXECUTE_INLINE), \ |
