Refactor DescribeVRegs to allow caching.

In oatdump we want to describe vregs at regular intervals and reverifying is
slow. Refactor MethodVerifier to allow this. Move instruction flags into its
own file so the complete type is visible to files other than method verifier.

Change-Id: I14d491e7376ab1d7117a9725847870ef1337803f
diff --git a/src/verifier/instruction_flags.cc b/src/verifier/instruction_flags.cc
new file mode 100644
index 0000000..823edde
--- /dev/null
+++ b/src/verifier/instruction_flags.cc
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "instruction_flags.h"
+
+#include <string.h>
+
+namespace art {
+namespace verifier {
+
+std::string InstructionFlags::ToString() const {
+  char encoding[6];
+  if (!IsOpcode()) {
+    strncpy(encoding, "XXXXX", sizeof(encoding));
+  } else {
+    strncpy(encoding, "-----", sizeof(encoding));
+    if (IsInTry())        encoding[kInTry] = 'T';
+    if (IsBranchTarget()) encoding[kBranchTarget] = 'B';
+    if (IsGcPoint())      encoding[kGcPoint] = 'G';
+    if (IsVisited())      encoding[kVisited] = 'V';
+    if (IsChanged())      encoding[kChanged] = 'C';
+  }
+  return encoding;
+}
+
+}  // namespace verifier
+}  // namespace art