Add text-profile support for multiple ICs

Text profile inline-cache support was limited to methods with only a
single invoke. This extends support so it is instead based on the
receiver type and supports an arbitrary number of invokes. It does
assume that all invokes of the same receivers should have the same
ICs. This enables us to create text profiles that can survive most
common edits to the underlying java language files.

IC lines are of the following format

<<CLASS_GROUP>> := {CLASS}(,{CLASS})*
<<IC_GROUP>> := \[{CLASS}{CLASS_GROUP}
<<IC_LINE>> := {PROFILE_FLAGS}{CLASS}->{METHOD}\+{IC_GROUP}*

This means a typical line might look like:

```
HLTestInline;->inlineTriplePolymorphic(LSuper;LSecret;LSecret;)I+[LSuper;LSubA;,LSubB;,LSubC;[LSecret;LSubB;,LSubC;
```

Note that old style single-invoke IC lines are still supported as
well and their format has not changed.

Updated --dump-classes-and-methods to dump ICs using this format. Note
that it will combine ICs for different pcs with the same target so it
is possible to construct a profile where the 'profile -> dump ->
profile' operation is not idempotent. Any profile coming from a
text-dump will be idempotent under this transform.

Test: ./test.py --host
Bug: 168941430
Change-Id: I69ba3b312caa7ca454487aaeb49862e393de3a4a
diff --git a/test/ProfileTestMultiDex/Main.java b/test/ProfileTestMultiDex/Main.java
index 978cb2c..a84cb98 100644
--- a/test/ProfileTestMultiDex/Main.java
+++ b/test/ProfileTestMultiDex/Main.java
@@ -46,26 +46,58 @@
   public int noInlineCache(Super s) {
     return s.getValue();
   }
+
+  public int inlineMultiMonomorphic(Super s, Secret sec) {
+    return s.getValue() + sec.getIdentity();
+  }
+
+  public int inlineMultiPolymorphic(Super s, Secret sec) {
+    return s.getValue() + sec.getIdentity();
+  }
+
+  public int inlineTriplePolymorphic(Super s, Secret sec, Secret thr) {
+    return s.getValue() + sec.getIdentity() + thr.getIdentity();
+  }
+
+  public int inlineMultiMegamorphic(Super s, Secret sec) {
+    return s.getValue() + sec.getIdentity();
+  }
+
+  public int inlineMultiMissingTypes(Super s, Secret sec) {
+    return s.getValue() + sec.getIdentity();
+  }
+
+  public int noInlineCacheMulti(Super s, Secret sec) {
+    return s.getValue() + sec.getIdentity();
+  }
 }
 
-abstract class Super {
+abstract class Secret {
+  abstract int getIdentity();
+}
+
+abstract class Super extends Secret {
   abstract int getValue();
 }
 
 class SubA extends Super {
   int getValue() { return 42; }
+  int getIdentity() { return 24; }
 }
 
 class SubB extends Super {
   int getValue() { return 38; };
+  int getIdentity() { return 83; }
 }
 
 class SubD extends Super {
   int getValue() { return 20; };
+  int getIdentity() { return 2; };
 }
 
 class SubE extends Super {
   int getValue() { return 16; };
+  int getIdentity() { return 61; };
 }
 
 // Add a class with lots of methods so we can test profile guided compilation triggers.
diff --git a/test/ProfileTestMultiDex/Second.java b/test/ProfileTestMultiDex/Second.java
index a2bb8d4..c9b3c0b 100644
--- a/test/ProfileTestMultiDex/Second.java
+++ b/test/ProfileTestMultiDex/Second.java
@@ -28,6 +28,7 @@
 
 class SubC extends Super {
   int getValue() { return 24; }
+  int getIdentity() { return 42; }
 }
 
 class TestIntrinsicOatdump {
diff --git a/test/ProfileTestMultiDex/main.jpp b/test/ProfileTestMultiDex/main.jpp
index 0644072..bd548a8 100644
--- a/test/ProfileTestMultiDex/main.jpp
+++ b/test/ProfileTestMultiDex/main.jpp
@@ -4,6 +4,9 @@
 TestInqline:
   @@com.android.jack.annotations.ForceInMainDex
   class TestInline
+Secret:
+  @@com.android.jack.annotations.ForceInMainDex
+  class Secret
 Super:
   @@com.android.jack.annotations.ForceInMainDex
   class Super
diff --git a/test/ProfileTestMultiDex/main.list b/test/ProfileTestMultiDex/main.list
index 6ca79d4..8ef9280 100644
--- a/test/ProfileTestMultiDex/main.list
+++ b/test/ProfileTestMultiDex/main.list
@@ -1,5 +1,6 @@
 Main.class
 TestInline.class
+Secret.class
 Super.class
 SubA.class
 SubB.class