Correct Volatile SGET/SPUT format tag, add missing cases for JIT
Fix for http://b/issue?id=2971877, which was identified via
debug tracing on http://b/issue?id=2971569. There were a couple
of problems: first, the volatile sget/sput byte codes had the
wrong format tag (22c instead of 21c). Second, the JIT was missing
a couple of case statments to handle these. As far as the JIT goes,
this would not have caused correctness problems, but would have
been slower than necessary.
Change-Id: I57a41c4e063642b0c19acba5bb0855dd8ce2d4ba
diff --git a/libdex/InstrUtils.c b/libdex/InstrUtils.c
index a3ee859..b98f002 100644
--- a/libdex/InstrUtils.c
+++ b/libdex/InstrUtils.c
@@ -971,17 +971,19 @@
break;
case OP_IGET_WIDE_VOLATILE:
case OP_IPUT_WIDE_VOLATILE:
- case OP_SGET_WIDE_VOLATILE:
- case OP_SPUT_WIDE_VOLATILE:
case OP_IGET_VOLATILE:
case OP_IPUT_VOLATILE:
- case OP_SGET_VOLATILE:
- case OP_SPUT_VOLATILE:
case OP_IGET_OBJECT_VOLATILE:
case OP_IPUT_OBJECT_VOLATILE:
+ fmt = kFmt22c;
+ break;
case OP_SGET_OBJECT_VOLATILE:
case OP_SPUT_OBJECT_VOLATILE:
- fmt = kFmt22c;
+ case OP_SGET_VOLATILE:
+ case OP_SPUT_VOLATILE:
+ case OP_SGET_WIDE_VOLATILE:
+ case OP_SPUT_WIDE_VOLATILE:
+ fmt = kFmt21c;
break;
case OP_IGET_QUICK:
case OP_IGET_WIDE_QUICK:
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index 86c2e29..a04371e 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -1518,6 +1518,8 @@
break;
}
case OP_SPUT_OBJECT:
+ case OP_SPUT_OBJECT_VOLATILE:
+ case OP_SPUT_VOLATILE:
case OP_SPUT_BOOLEAN:
case OP_SPUT_CHAR:
case OP_SPUT_BYTE: