aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.c
diff options
context:
space:
mode:
authorbuzbee <buzbee@google.com>2011-04-04 12:25:57 -0700
committerbuzbee <buzbee@google.com>2011-04-04 12:25:57 -0700
commit8b94be1f80b135e7a5c1f542861f3e80c4c52823 (patch)
tree37526acca492e059da6ed0acd6a5513af78a6422 /vm/compiler/codegen/arm/CodegenDriver.c
parent1d41040ad8175f89f1c19a4dfbaf6ae47baf7947 (diff)
[JIT] Rely on the opcode only to determine volatile
In the past, it was possible to have a volatile field with a non-volatile opcode. This is no longer the case, so this change eliminates the volatile field flag check. Change-Id: I1cface4e813144634b2f90732c76b0a16f08c304
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index 465eade83..e4c45367c 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -1648,8 +1648,9 @@ static bool handleFmt21c_Fmt31c_Fmt41c(CompilationUnit *cUnit, MIR *mir)
isVolatile = (opcode == OP_SGET_VOLATILE) ||
(opcode == OP_SGET_VOLATILE_JUMBO) ||
(opcode == OP_SGET_OBJECT_VOLATILE) ||
- (opcode == OP_SGET_OBJECT_VOLATILE_JUMBO) ||
- dvmIsVolatileField((Field *) fieldPtr);
+ (opcode == OP_SGET_OBJECT_VOLATILE_JUMBO);
+
+ assert(isVolatile == dvmIsVolatileField((Field *) fieldPtr));
rlDest = dvmCompilerGetDest(cUnit, mir, 0);
rlResult = dvmCompilerEvalLoc(cUnit, rlDest, kAnyReg, true);
@@ -1727,8 +1728,9 @@ static bool handleFmt21c_Fmt31c_Fmt41c(CompilationUnit *cUnit, MIR *mir)
isVolatile = (opcode == OP_SPUT_VOLATILE) ||
(opcode == OP_SPUT_VOLATILE_JUMBO) ||
(opcode == OP_SPUT_OBJECT_VOLATILE) ||
- (opcode == OP_SPUT_OBJECT_VOLATILE_JUMBO) ||
- dvmIsVolatileField((Field *) fieldPtr);
+ (opcode == OP_SPUT_OBJECT_VOLATILE_JUMBO);
+
+ assert(isVolatile == dvmIsVolatileField((Field *) fieldPtr));
isSputObject = (opcode == OP_SPUT_OBJECT) ||
(opcode == OP_SPUT_OBJECT_JUMBO) ||
@@ -2400,15 +2402,21 @@ static bool handleFmt22c_Fmt52c(CompilationUnit *cUnit, MIR *mir)
* case OP_IPUT_WIDE_VOLATILE:
* case OP_IPUT_WIDE_VOLATILE_JUMBO:
*/
- case OP_IGET:
case OP_IGET_VOLATILE:
case OP_IGET_VOLATILE_JUMBO:
+ case OP_IGET_OBJECT_VOLATILE:
+ case OP_IGET_OBJECT_VOLATILE_JUMBO:
+ case OP_IPUT_VOLATILE:
+ case OP_IPUT_VOLATILE_JUMBO:
+ case OP_IPUT_OBJECT_VOLATILE:
+ case OP_IPUT_OBJECT_VOLATILE_JUMBO:
+ isVolatile = true;
+ // NOTE: intentional fallthrough
+ case OP_IGET:
case OP_IGET_JUMBO:
case OP_IGET_WIDE:
case OP_IGET_WIDE_JUMBO:
case OP_IGET_OBJECT:
- case OP_IGET_OBJECT_VOLATILE:
- case OP_IGET_OBJECT_VOLATILE_JUMBO:
case OP_IGET_OBJECT_JUMBO:
case OP_IGET_BOOLEAN:
case OP_IGET_BOOLEAN_JUMBO:
@@ -2419,14 +2427,10 @@ static bool handleFmt22c_Fmt52c(CompilationUnit *cUnit, MIR *mir)
case OP_IGET_SHORT:
case OP_IGET_SHORT_JUMBO:
case OP_IPUT:
- case OP_IPUT_VOLATILE:
- case OP_IPUT_VOLATILE_JUMBO:
case OP_IPUT_JUMBO:
case OP_IPUT_WIDE:
case OP_IPUT_WIDE_JUMBO:
case OP_IPUT_OBJECT:
- case OP_IPUT_OBJECT_VOLATILE:
- case OP_IPUT_OBJECT_VOLATILE_JUMBO:
case OP_IPUT_OBJECT_JUMBO:
case OP_IPUT_BOOLEAN:
case OP_IPUT_BOOLEAN_JUMBO:
@@ -2446,7 +2450,7 @@ static bool handleFmt22c_Fmt52c(CompilationUnit *cUnit, MIR *mir)
LOGE("Unexpected null instance field");
dvmAbort();
}
- isVolatile = dvmIsVolatileField(fieldPtr);
+ assert(isVolatile == dvmIsVolatileField(fieldPtr));
fieldOffset = ((InstField *)fieldPtr)->byteOffset;
break;
}