Clean up stale cases

Substitution of "volatile" ops was once done by the verifier, which
meant the verifier could see them.  This is no longer the case, so we
don't need to be handling them.

Change-Id: I6e4cd24dd65a1c28d4e5ee781be6e3499562a05b
diff --git a/vm/analysis/CodeVerify.c b/vm/analysis/CodeVerify.c
index 1ddc713..37a8951 100644
--- a/vm/analysis/CodeVerify.c
+++ b/vm/analysis/CodeVerify.c
@@ -4742,9 +4742,7 @@
         break;
 
     case OP_IGET:
-    case OP_IGET_VOLATILE:
     case OP_IGET_JUMBO:
-    case OP_IGET_VOLATILE_JUMBO:
         tmpType = kRegTypeInteger;
         goto iget_1nr_common;
     case OP_IGET_BOOLEAN:
@@ -4790,9 +4788,7 @@
         }
         break;
     case OP_IGET_WIDE:
-    case OP_IGET_WIDE_VOLATILE:
     case OP_IGET_WIDE_JUMBO:
-    case OP_IGET_WIDE_VOLATILE_JUMBO:
         {
             RegType dstType;
             InstField* instField;
@@ -4825,9 +4821,7 @@
         }
         break;
     case OP_IGET_OBJECT:
-    case OP_IGET_OBJECT_VOLATILE:
     case OP_IGET_OBJECT_JUMBO:
-    case OP_IGET_OBJECT_VOLATILE_JUMBO:
         {
             ClassObject* fieldClass;
             InstField* instField;
@@ -4854,9 +4848,7 @@
         }
         break;
     case OP_IPUT:
-    case OP_IPUT_VOLATILE:
     case OP_IPUT_JUMBO:
-    case OP_IPUT_VOLATILE_JUMBO:
         tmpType = kRegTypeInteger;
         goto iput_1nr_common;
     case OP_IPUT_BOOLEAN:
@@ -4920,9 +4912,7 @@
         }
         break;
     case OP_IPUT_WIDE:
-    case OP_IPUT_WIDE_VOLATILE:
     case OP_IPUT_WIDE_JUMBO:
-    case OP_IPUT_WIDE_VOLATILE_JUMBO:
         tmpType = getRegisterType(workLine, decInsn.vA);
         {
             RegType typeHi = getRegisterType(workLine, decInsn.vA+1);
@@ -4958,9 +4948,7 @@
         }
         break;
     case OP_IPUT_OBJECT:
-    case OP_IPUT_OBJECT_VOLATILE:
     case OP_IPUT_OBJECT_JUMBO:
-    case OP_IPUT_OBJECT_VOLATILE_JUMBO:
         {
             ClassObject* fieldClass;
             ClassObject* valueClass;
@@ -5016,9 +5004,7 @@
         break;
 
     case OP_SGET:
-    case OP_SGET_VOLATILE:
     case OP_SGET_JUMBO:
-    case OP_SGET_VOLATILE_JUMBO:
         tmpType = kRegTypeInteger;
         goto sget_1nr_common;
     case OP_SGET_BOOLEAN:
@@ -5067,9 +5053,7 @@
         }
         break;
     case OP_SGET_WIDE:
-    case OP_SGET_WIDE_VOLATILE:
     case OP_SGET_WIDE_JUMBO:
-    case OP_SGET_WIDE_VOLATILE_JUMBO:
         {
             StaticField* staticField;
             RegType dstType;
@@ -5099,9 +5083,7 @@
         }
         break;
     case OP_SGET_OBJECT:
-    case OP_SGET_OBJECT_VOLATILE:
     case OP_SGET_OBJECT_JUMBO:
-    case OP_SGET_OBJECT_VOLATILE_JUMBO:
         {
             StaticField* staticField;
             ClassObject* fieldClass;
@@ -5125,9 +5107,7 @@
         }
         break;
     case OP_SPUT:
-    case OP_SPUT_VOLATILE:
     case OP_SPUT_JUMBO:
-    case OP_SPUT_VOLATILE_JUMBO:
         tmpType = kRegTypeInteger;
         goto sput_1nr_common;
     case OP_SPUT_BOOLEAN:
@@ -5193,9 +5173,7 @@
         }
         break;
     case OP_SPUT_WIDE:
-    case OP_SPUT_WIDE_VOLATILE:
     case OP_SPUT_WIDE_JUMBO:
-    case OP_SPUT_WIDE_VOLATILE_JUMBO:
         tmpType = getRegisterType(workLine, decInsn.vA);
         {
             RegType typeHi = getRegisterType(workLine, decInsn.vA+1);
@@ -5228,9 +5206,7 @@
         }
         break;
     case OP_SPUT_OBJECT:
-    case OP_SPUT_OBJECT_VOLATILE:
     case OP_SPUT_OBJECT_JUMBO:
-    case OP_SPUT_OBJECT_VOLATILE_JUMBO:
         {
             ClassObject* fieldClass;
             ClassObject* valueClass;
@@ -5752,8 +5728,6 @@
      */
     case OP_EXECUTE_INLINE:
     case OP_EXECUTE_INLINE_RANGE:
-    case OP_INVOKE_OBJECT_INIT_RANGE:
-    case OP_INVOKE_OBJECT_INIT_JUMBO:
     case OP_IGET_QUICK:
     case OP_IGET_WIDE_QUICK:
     case OP_IGET_OBJECT_QUICK:
@@ -5764,9 +5738,43 @@
     case OP_INVOKE_VIRTUAL_QUICK_RANGE:
     case OP_INVOKE_SUPER_QUICK:
     case OP_INVOKE_SUPER_QUICK_RANGE:
+        /* fall through to failure */
+
+    /*
+     * These instructions are equivalent (from the verifier's point of view)
+     * to the original form.  The change was made for correctness rather
+     * than improved performance (except for invoke-object-init, which
+     * provides both).  The substitution takes place after verification
+     * completes, though, so we don't expect to see them here.
+     */
+    case OP_INVOKE_OBJECT_INIT_RANGE:
+    case OP_INVOKE_OBJECT_INIT_JUMBO:
     case OP_RETURN_VOID_BARRIER:
-        failure = VERIFY_ERROR_GENERIC;
-        break;
+    case OP_IGET_VOLATILE:
+    case OP_IGET_VOLATILE_JUMBO:
+    case OP_IGET_WIDE_VOLATILE:
+    case OP_IGET_WIDE_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_WIDE_VOLATILE:
+    case OP_IPUT_WIDE_VOLATILE_JUMBO:
+    case OP_IPUT_OBJECT_VOLATILE:
+    case OP_IPUT_OBJECT_VOLATILE_JUMBO:
+    case OP_SGET_VOLATILE:
+    case OP_SGET_VOLATILE_JUMBO:
+    case OP_SGET_WIDE_VOLATILE:
+    case OP_SGET_WIDE_VOLATILE_JUMBO:
+    case OP_SGET_OBJECT_VOLATILE:
+    case OP_SGET_OBJECT_VOLATILE_JUMBO:
+    case OP_SPUT_VOLATILE:
+    case OP_SPUT_VOLATILE_JUMBO:
+    case OP_SPUT_WIDE_VOLATILE:
+    case OP_SPUT_WIDE_VOLATILE_JUMBO:
+    case OP_SPUT_OBJECT_VOLATILE:
+    case OP_SPUT_OBJECT_VOLATILE_JUMBO:
+        /* fall through to failure */
 
     /* these should never appear during verification */
     case OP_UNUSED_3E:
diff --git a/vm/analysis/DexVerify.c b/vm/analysis/DexVerify.c
index 7f06320..16e5738 100644
--- a/vm/analysis/DexVerify.c
+++ b/vm/analysis/DexVerify.c
@@ -1435,7 +1435,7 @@
         case OP_UNUSED_EFFF:
         case OP_UNUSED_F0FF:
         case OP_UNUSED_F1FF:
-            LOGE("VFY: unexpected opcode %02x\n", decInsn.opcode);
+            LOGE("VFY: unexpected opcode %04x\n", decInsn.opcode);
             okay = false;
             break;
 
diff --git a/vm/analysis/Liveness.c b/vm/analysis/Liveness.c
index 2e60780..2f5173b 100644
--- a/vm/analysis/Liveness.c
+++ b/vm/analysis/Liveness.c
@@ -359,9 +359,7 @@
     case OP_IF_GTZ:
     case OP_IF_LEZ:
     case OP_SPUT:
-    case OP_SPUT_VOLATILE:
     case OP_SPUT_JUMBO:
-    case OP_SPUT_VOLATILE_JUMBO:
     case OP_SPUT_BOOLEAN:
     case OP_SPUT_BOOLEAN_JUMBO:
     case OP_SPUT_BYTE:
@@ -371,18 +369,14 @@
     case OP_SPUT_SHORT:
     case OP_SPUT_SHORT_JUMBO:
     case OP_SPUT_OBJECT:
-    case OP_SPUT_OBJECT_VOLATILE:
     case OP_SPUT_OBJECT_JUMBO:
-    case OP_SPUT_OBJECT_VOLATILE_JUMBO:
         /* action <- vA */
         GEN(workBits, decInsn.vA);
         break;
 
     case OP_RETURN_WIDE:
     case OP_SPUT_WIDE:
-    case OP_SPUT_WIDE_VOLATILE:
     case OP_SPUT_WIDE_JUMBO:
-    case OP_SPUT_WIDE_VOLATILE_JUMBO:
         /* action <- vA(wide) */
         GENW(workBits, decInsn.vA);
         break;
@@ -394,9 +388,7 @@
     case OP_IF_GT:
     case OP_IF_LE:
     case OP_IPUT:
-    case OP_IPUT_VOLATILE:
     case OP_IPUT_JUMBO:
-    case OP_IPUT_VOLATILE_JUMBO:
     case OP_IPUT_BOOLEAN:
     case OP_IPUT_BOOLEAN_JUMBO:
     case OP_IPUT_BYTE:
@@ -406,18 +398,14 @@
     case OP_IPUT_SHORT:
     case OP_IPUT_SHORT_JUMBO:
     case OP_IPUT_OBJECT:
-    case OP_IPUT_OBJECT_VOLATILE:
     case OP_IPUT_OBJECT_JUMBO:
-    case OP_IPUT_OBJECT_VOLATILE_JUMBO:
         /* action <- vA, vB */
         GEN(workBits, decInsn.vA);
         GEN(workBits, decInsn.vB);
         break;
 
     case OP_IPUT_WIDE:
-    case OP_IPUT_WIDE_VOLATILE:
     case OP_IPUT_WIDE_JUMBO:
-    case OP_IPUT_WIDE_VOLATILE_JUMBO:
         /* action <- vA(wide), vB */
         GENW(workBits, decInsn.vA);
         GEN(workBits, decInsn.vB);
@@ -493,9 +481,7 @@
     case OP_NEW_INSTANCE:
     case OP_NEW_INSTANCE_JUMBO:
     case OP_SGET:
-    case OP_SGET_VOLATILE:
     case OP_SGET_JUMBO:
-    case OP_SGET_VOLATILE_JUMBO:
     case OP_SGET_BOOLEAN:
     case OP_SGET_BOOLEAN_JUMBO:
     case OP_SGET_BYTE:
@@ -505,9 +491,7 @@
     case OP_SGET_SHORT:
     case OP_SGET_SHORT_JUMBO:
     case OP_SGET_OBJECT:
-    case OP_SGET_OBJECT_VOLATILE:
     case OP_SGET_OBJECT_JUMBO:
-    case OP_SGET_OBJECT_VOLATILE_JUMBO:
         /* vA <- value */
         KILL(workBits, decInsn.vA);
         break;
@@ -517,9 +501,7 @@
     case OP_CONST_WIDE:
     case OP_CONST_WIDE_HIGH16:
     case OP_SGET_WIDE:
-    case OP_SGET_WIDE_VOLATILE:
     case OP_SGET_WIDE_JUMBO:
-    case OP_SGET_WIDE_VOLATILE_JUMBO:
         /* vA(wide) <- value */
         KILLW(workBits, decInsn.vA);
         break;
@@ -536,9 +518,7 @@
     case OP_NEW_ARRAY:
     case OP_NEW_ARRAY_JUMBO:
     case OP_IGET:
-    case OP_IGET_VOLATILE:
     case OP_IGET_JUMBO:
-    case OP_IGET_VOLATILE_JUMBO:
     case OP_IGET_BOOLEAN:
     case OP_IGET_BOOLEAN_JUMBO:
     case OP_IGET_BYTE:
@@ -548,9 +528,7 @@
     case OP_IGET_SHORT:
     case OP_IGET_SHORT_JUMBO:
     case OP_IGET_OBJECT:
-    case OP_IGET_OBJECT_VOLATILE:
     case OP_IGET_OBJECT_JUMBO:
-    case OP_IGET_OBJECT_VOLATILE_JUMBO:
     case OP_NEG_INT:
     case OP_NOT_INT:
     case OP_NEG_FLOAT:
@@ -584,9 +562,7 @@
         break;
 
     case OP_IGET_WIDE:
-    case OP_IGET_WIDE_VOLATILE:
     case OP_IGET_WIDE_JUMBO:
-    case OP_IGET_WIDE_VOLATILE_JUMBO:
     case OP_INT_TO_LONG:
     case OP_INT_TO_DOUBLE:
     case OP_FLOAT_TO_LONG:
@@ -751,8 +727,6 @@
     /* quickened instructions, not expected to appear */
     case OP_EXECUTE_INLINE:
     case OP_EXECUTE_INLINE_RANGE:
-    case OP_INVOKE_OBJECT_INIT_RANGE:
-    case OP_INVOKE_OBJECT_INIT_JUMBO:
     case OP_IGET_QUICK:
     case OP_IGET_WIDE_QUICK:
     case OP_IGET_OBJECT_QUICK:
@@ -763,8 +737,37 @@
     case OP_INVOKE_VIRTUAL_QUICK_RANGE:
     case OP_INVOKE_SUPER_QUICK:
     case OP_INVOKE_SUPER_QUICK_RANGE:
+        /* fall through to failure */
+
+    /* correctness fixes, not expected to appear */
+    case OP_INVOKE_OBJECT_INIT_RANGE:
+    case OP_INVOKE_OBJECT_INIT_JUMBO:
     case OP_RETURN_VOID_BARRIER:
-        return false;
+    case OP_SPUT_VOLATILE:
+    case OP_SPUT_VOLATILE_JUMBO:
+    case OP_SPUT_OBJECT_VOLATILE:
+    case OP_SPUT_OBJECT_VOLATILE_JUMBO:
+    case OP_SPUT_WIDE_VOLATILE:
+    case OP_SPUT_WIDE_VOLATILE_JUMBO:
+    case OP_IPUT_VOLATILE:
+    case OP_IPUT_VOLATILE_JUMBO:
+    case OP_IPUT_OBJECT_VOLATILE:
+    case OP_IPUT_OBJECT_VOLATILE_JUMBO:
+    case OP_IPUT_WIDE_VOLATILE:
+    case OP_IPUT_WIDE_VOLATILE_JUMBO:
+    case OP_SGET_VOLATILE:
+    case OP_SGET_VOLATILE_JUMBO:
+    case OP_SGET_OBJECT_VOLATILE:
+    case OP_SGET_OBJECT_VOLATILE_JUMBO:
+    case OP_SGET_WIDE_VOLATILE:
+    case OP_SGET_WIDE_VOLATILE_JUMBO:
+    case OP_IGET_VOLATILE:
+    case OP_IGET_VOLATILE_JUMBO:
+    case OP_IGET_OBJECT_VOLATILE:
+    case OP_IGET_OBJECT_VOLATILE_JUMBO:
+    case OP_IGET_WIDE_VOLATILE:
+    case OP_IGET_WIDE_VOLATILE_JUMBO:
+        /* fall through to failure */
 
     /* these should never appear during verification */
     case OP_UNUSED_3E: