Add invoke infos to stack maps

Invoke info records the invoke type and dex method index for invokes
that may reach artQuickResolutionTrampoline. Having this information
recorded allows the runtime to avoid reading the dex code and pulling
in extra pages.

Code size increase for a large app:
93886360 -> 95811480 (2.05% increase)

1/2 of the code size increase is from making less stack maps deduped.
I suspect there is less deduping because of the invoke info method
index.

Merged disabled until we measure the RAM savings.

Test: test-art-host, N6P boots

Bug: 34109702

Change-Id: I6c5e4a60675a1d7c76dee0561a12909e4ab6d5d9
diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h
index bba3d51..4225a87 100644
--- a/compiler/optimizing/stack_map_stream.h
+++ b/compiler/optimizing/stack_map_stream.h
@@ -118,6 +118,8 @@
     uint32_t register_mask_index;
     DexRegisterMapEntry dex_register_entry;
     size_t dex_register_map_index;
+    InvokeType invoke_type;
+    uint32_t dex_method_index;
   };
 
   struct InlineInfoEntry {
@@ -138,6 +140,8 @@
 
   void AddDexRegisterEntry(DexRegisterLocation::Kind kind, int32_t value);
 
+  void AddInvoke(InvokeType type, uint32_t dex_method_index);
+
   void BeginInlineInfoEntry(ArtMethod* method,
                             uint32_t dex_pc,
                             uint32_t num_dex_registers,
@@ -184,6 +188,14 @@
   bool DexRegisterMapEntryEquals(const DexRegisterMapEntry& a, const DexRegisterMapEntry& b) const;
 
   // Fill in the corresponding entries of a register map.
+  void ComputeInvokeInfoEncoding(CodeInfoEncoding* encoding);
+
+  // Returns the index of an entry with the same dex register map as the current_entry,
+  // or kNoSameDexMapFound if no such entry exists.
+  size_t FindEntryWithTheSameDexMap();
+  bool HaveTheSameDexMaps(const StackMapEntry& a, const StackMapEntry& b) const;
+
+  // Fill in the corresponding entries of a register map.
   void FillInDexRegisterMap(DexRegisterMap dex_register_map,
                             uint32_t num_dex_registers,
                             const BitVector& live_dex_registers_mask,