Refactor profiles to use TypeReference instead of ClassReference

Refactor type reference into runtime and use it for profiles.
ClassReference was just duplicated code since it wasn't even using
the class def indexes.

Test: test-art-host

Bug: 62040831
Change-Id: Ia92f21c0e85c00321f52c97bb7a90158d882849b
diff --git a/profman/profman.cc b/profman/profman.cc
index 366b4de..e565171 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -39,10 +39,11 @@
 #include "bytecode_utils.h"
 #include "dex_file.h"
 #include "jit/profile_compilation_info.h"
+#include "profile_assistant.h"
 #include "runtime.h"
+#include "type_reference.h"
 #include "utils.h"
 #include "zip_archive.h"
-#include "profile_assistant.h"
 
 namespace art {
 
@@ -560,7 +561,7 @@
   // Return true if the definition of the class was found in any of the dex_files.
   bool FindClass(const std::vector<std::unique_ptr<const DexFile>>& dex_files,
                  const std::string& klass_descriptor,
-                 /*out*/ProfileMethodInfo::ProfileClassReference* class_ref) {
+                 /*out*/TypeReference* class_ref) {
     for (const std::unique_ptr<const DexFile>& dex_file_ptr : dex_files) {
       const DexFile* dex_file = dex_file_ptr.get();
       const DexFile::TypeId* type_id = dex_file->FindTypeId(klass_descriptor.c_str());
@@ -580,8 +581,7 @@
   }
 
   // Find the method specified by method_spec in the class class_ref.
-  uint32_t FindMethodIndex(const ProfileMethodInfo::ProfileClassReference& class_ref,
-                           const std::string& method_spec) {
+  uint32_t FindMethodIndex(const TypeReference& class_ref, const std::string& method_spec) {
     std::vector<std::string> name_and_signature;
     Split(method_spec, kProfileParsingFirstCharInSignature, &name_and_signature);
     if (name_and_signature.size() != 2) {
@@ -623,7 +623,7 @@
   // The format of the method spec is "inlinePolymorphic(LSuper;)I+LSubA;,LSubB;,LSubC;".
   //
   // TODO(calin): support INVOKE_INTERFACE and the range variants.
-  bool HasSingleInvoke(const ProfileMethodInfo::ProfileClassReference& class_ref,
+  bool HasSingleInvoke(const TypeReference& class_ref,
                        uint16_t method_index,
                        /*out*/uint32_t* dex_pc) {
     const DexFile* dex_file = class_ref.dex_file;
@@ -672,7 +672,7 @@
       method_str = line.substr(method_sep_index + kMethodSep.size());
     }
 
-    ProfileMethodInfo::ProfileClassReference class_ref;
+    TypeReference class_ref;
     if (!FindClass(dex_files, klass, &class_ref)) {
       LOG(WARNING) << "Could not find class: " << klass;
       return false;
@@ -743,7 +743,7 @@
       if (!HasSingleInvoke(class_ref, method_index, &dex_pc)) {
         return false;
       }
-      std::vector<ProfileMethodInfo::ProfileClassReference> classes(inline_cache_elems.size());
+      std::vector<TypeReference> classes(inline_cache_elems.size());
       size_t class_it = 0;
       for (const std::string& ic_class : inline_cache_elems) {
         if (!FindClass(dex_files, ic_class, &(classes[class_it++]))) {