Reduce quicken info size

Move the quicken info from using a map of <dex pc, index> to an array
of indices. Removed leb encoding since it is harmful for 16 bit
indices. The map is indexed by the dequickenable instruction index
from the start of the code item.

Numbers for a certain large app compiled with quicken filter:
dex2oat native alloc: 85345936B -> 81527072B
oat file size: 9068968B -> 8659368B
vdex file size: 90479120B -> 86321184B

Bug: 63467744
Bug: 36457259
Test: test-art-host

(cherry picked from commit 959f348acabc48efbb18c547dad6300c0f610c1c)

Change-Id: I85546d8cd409cbf96140cbdddabd7e228797b9e3
diff --git a/runtime/quicken_info.h b/runtime/quicken_info.h
new file mode 100644
index 0000000..5b72468
--- /dev/null
+++ b/runtime/quicken_info.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#ifndef ART_RUNTIME_QUICKEN_INFO_H_
+#define ART_RUNTIME_QUICKEN_INFO_H_
+
+#include "dex_instruction.h"
+
+namespace art {
+
+// QuickenInfoTable is a table of 16 bit dex indices. There is one slot fo every instruction that is
+// possibly dequickenable.
+class QuickenInfoTable {
+ public:
+  explicit QuickenInfoTable(const uint8_t* data) : data_(data) {}
+
+  bool IsNull() const {
+    return data_ == nullptr;
+  }
+
+  uint16_t GetData(size_t index) const {
+    return data_[index * 2] | (static_cast<uint16_t>(data_[index * 2 + 1]) << 8);
+  }
+
+  // Returns true if the dex instruction has an index in the table. (maybe dequickenable).
+  static bool NeedsIndexForInstruction(const Instruction* inst) {
+    return inst->IsQuickened() || inst->Opcode() == Instruction::NOP;
+  }
+
+  static size_t NumberOfIndices(size_t bytes) {
+    return bytes / sizeof(uint16_t);
+  }
+
+ private:
+  const uint8_t* const data_;
+
+  DISALLOW_COPY_AND_ASSIGN(QuickenInfoTable);
+};
+
+}  // namespace art
+
+#endif  // ART_RUNTIME_QUICKEN_INFO_H_