Add support invoke-polymorphic to dexdump

o Update bytecode.txt with codepoints for invoke-polymorphic
  instructions and run opcode-gen/regen-all.

o Update dexdump to support invoke-polymorphic with output equivalent to
  dexdump2.

o Add format classes to dexgen and dx.

Bug: 30550796
Test: manually tested with DEX files generated from ART run-tests.
Change-Id: I986a896747d73e11418ba1876cce86087b4a9e68
diff --git a/opcode-gen/bytecode.txt b/opcode-gen/bytecode.txt
index 6b7b9b1..dc0778d 100644
--- a/opcode-gen/bytecode.txt
+++ b/opcode-gen/bytecode.txt
@@ -39,9 +39,10 @@
 format 22c
 format 22t
 format 35c 3rc
+format 45cc 4rcc
 
 # Optimized formats
-format 00x 
+format 00x
 format 20bc
 format 22cs
 format 35mi
@@ -67,6 +68,7 @@
 #     inline-method
 #     vtable-offset
 #     field-offset
+#     method-and-proto-ref
 #   flags; pipe-combined combo of one or more of:
 #     optimized     -- optimized; not to be included in unoptimized dex files
 #     branch        -- might branch to an address
@@ -337,8 +339,13 @@
 op   f7 +iput-object-quick          22cs n field-offset  optimized|continue|throw
 op   f8 +invoke-virtual-quick       35ms n vtable-offset optimized|continue|throw|invoke
 op   f9 +invoke-virtual-quick/range 3rms n vtable-offset optimized|continue|throw|invoke
-op   fa +invoke-super-quick         35ms n vtable-offset optimized|continue|throw|invoke
-op   fb +invoke-super-quick/range   3rms n vtable-offset optimized|continue|throw|invoke
+
+# Invoke-polymorphic
+op   fa invoke-polymorphic          45cc y method-and-proto-ref continue|throw|invoke
+op   fb invoke-polymorphic/range    4rcc y method-and-proto-ref continue|throw|invoke
+
+# More optimized opcodes (not valid in an unoptimized dex file)
+
 op   fc +iput-object-volatile       22c  n field-ref     optimized|continue|throw
 op   fd +sget-object-volatile       21c  y field-ref     optimized|continue|throw
 op   fe +sput-object-volatile       21c  n field-ref     optimized|continue|throw
diff --git a/opcode-gen/opcode-gen.awk b/opcode-gen/opcode-gen.awk
index e26a60c..d1e9a08 100644
--- a/opcode-gen/opcode-gen.awk
+++ b/opcode-gen/opcode-gen.awk
@@ -474,16 +474,17 @@
 
 # Initialize the indexTypes data.
 function initIndexTypes() {
-    indexTypeValues["unknown"]       = "kIndexUnknown";
-    indexTypeValues["none"]          = "kIndexNone";
-    indexTypeValues["varies"]        = "kIndexVaries";
-    indexTypeValues["type-ref"]      = "kIndexTypeRef";
-    indexTypeValues["string-ref"]    = "kIndexStringRef";
-    indexTypeValues["method-ref"]    = "kIndexMethodRef";
-    indexTypeValues["field-ref"]     = "kIndexFieldRef";
-    indexTypeValues["inline-method"] = "kIndexInlineMethod";
-    indexTypeValues["vtable-offset"] = "kIndexVtableOffset";
-    indexTypeValues["field-offset"]  = "kIndexFieldOffset";
+    indexTypeValues["unknown"]              = "kIndexUnknown";
+    indexTypeValues["none"]                 = "kIndexNone";
+    indexTypeValues["varies"]               = "kIndexVaries";
+    indexTypeValues["type-ref"]             = "kIndexTypeRef";
+    indexTypeValues["string-ref"]           = "kIndexStringRef";
+    indexTypeValues["method-ref"]           = "kIndexMethodRef";
+    indexTypeValues["field-ref"]            = "kIndexFieldRef";
+    indexTypeValues["inline-method"]        = "kIndexInlineMethod";
+    indexTypeValues["vtable-offset"]        = "kIndexVtableOffset";
+    indexTypeValues["field-offset"]         = "kIndexFieldOffset";
+    indexTypeValues["method-and-proto-ref"] = "kIndexMethodAndProtoRef";
 }
 
 # Initialize the flags data.