Remove mirror:: and ArtMethod deps in utils.{h,cc}

The latest chapter in the ongoing saga of attempting to dump a DEX
file without having to start a whole runtime instance.  This episode
finds us removing references to ArtMethod/ArtField/mirror.

One aspect of this change that I would like to call out specfically
is that the utils versions of the "Pretty*" functions all were written
to accept nullptr as an argument.  I have split these functions up as
follows:
1) an instance method, such as PrettyClass that obviously requires
this != nullptr.
2) a static method, that behaves the same way as the util method, but
calls the instance method if p != nullptr.
This requires using a full class qualifier for the static methods,
which isn't exactly beautiful.  I have tried to remove as many cases
as possible where it was clear p != nullptr.

Bug: 22322814
Test: test-art-host
Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 86742e6..2927e1f 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -51,7 +51,7 @@
 
   if (compiler_options.IsHugeMethod(code_item_.insns_size_in_code_units_)) {
     VLOG(compiler) << "Skip compilation of huge method "
-                   << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_)
+                   << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
                    << ": " << code_item_.insns_size_in_code_units_ << " code units";
     MaybeRecordStat(MethodCompilationStat::kNotCompiledHugeMethod);
     return true;
@@ -61,7 +61,7 @@
   if (compiler_options.IsLargeMethod(code_item_.insns_size_in_code_units_)
       && (number_of_branches == 0)) {
     VLOG(compiler) << "Skip compilation of large method with no branch "
-                   << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_)
+                   << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
                    << ": " << code_item_.insns_size_in_code_units_ << " code units";
     MaybeRecordStat(MethodCompilationStat::kNotCompiledLargeMethodNoBranches);
     return true;
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc
index 912ee29..09dcefa 100644
--- a/compiler/optimizing/graph_visualizer.cc
+++ b/compiler/optimizing/graph_visualizer.cc
@@ -441,8 +441,8 @@
 
   void VisitInvoke(HInvoke* invoke) OVERRIDE {
     StartAttributeStream("dex_file_index") << invoke->GetDexMethodIndex();
-    StartAttributeStream("method_name") << PrettyMethod(
-        invoke->GetDexMethodIndex(), GetGraph()->GetDexFile(), /* with_signature */ false);
+    StartAttributeStream("method_name") << GetGraph()->GetDexFile().PrettyMethod(
+        invoke->GetDexMethodIndex(), /* with_signature */ false);
   }
 
   void VisitInvokeUnresolved(HInvokeUnresolved* invoke) OVERRIDE {
@@ -465,15 +465,15 @@
   }
 
   void VisitInstanceFieldGet(HInstanceFieldGet* iget) OVERRIDE {
-    StartAttributeStream("field_name") << PrettyField(iget->GetFieldInfo().GetFieldIndex(),
-                                                      iget->GetFieldInfo().GetDexFile(),
+    StartAttributeStream("field_name") <<
+        iget->GetFieldInfo().GetDexFile().PrettyField(iget->GetFieldInfo().GetFieldIndex(),
                                                       /* with type */ false);
     StartAttributeStream("field_type") << iget->GetFieldType();
   }
 
   void VisitInstanceFieldSet(HInstanceFieldSet* iset) OVERRIDE {
-    StartAttributeStream("field_name") << PrettyField(iset->GetFieldInfo().GetFieldIndex(),
-                                                      iset->GetFieldInfo().GetDexFile(),
+    StartAttributeStream("field_name") <<
+        iset->GetFieldInfo().GetDexFile().PrettyField(iset->GetFieldInfo().GetFieldIndex(),
                                                       /* with type */ false);
     StartAttributeStream("field_type") << iset->GetFieldType();
   }
@@ -604,7 +604,8 @@
         : instruction->GetReferenceTypeInfo();
       ScopedObjectAccess soa(Thread::Current());
       if (info.IsValid()) {
-        StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get());
+        StartAttributeStream("klass")
+            << mirror::Class::PrettyDescriptor(info.GetTypeHandle().Get());
         StartAttributeStream("can_be_null")
             << std::boolalpha << instruction->CanBeNull() << std::noboolalpha;
         StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha;
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 6080551..9faa98a 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -90,14 +90,14 @@
         if (!TryInline(call)) {
           if (kIsDebugBuild && IsCompilingWithCoreImage()) {
             std::string callee_name =
-                PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile());
+                outer_compilation_unit_.GetDexFile()->PrettyMethod(call->GetDexMethodIndex());
             bool should_inline = callee_name.find("$inline$") != std::string::npos;
             CHECK(!should_inline) << "Could not inline " << callee_name;
           }
         } else {
           if (kIsDebugBuild && IsCompilingWithCoreImage()) {
             std::string callee_name =
-                PrettyMethod(call->GetDexMethodIndex(), *outer_compilation_unit_.GetDexFile());
+                outer_compilation_unit_.GetDexFile()->PrettyMethod(call->GetDexMethodIndex());
             bool must_not_inline = callee_name.find("$noinline$") != std::string::npos;
             CHECK(!must_not_inline) << "Should not have inlined " << callee_name;
           }
@@ -203,10 +203,10 @@
     REQUIRES_SHARED(Locks::mutator_lock_) {
   uint32_t index = DexFile::kDexNoIndex;
   if (cls->GetDexCache() == nullptr) {
-    DCHECK(cls->IsArrayClass()) << PrettyClass(cls);
+    DCHECK(cls->IsArrayClass()) << cls->PrettyClass();
     index = cls->FindTypeIndexInOtherDexFile(dex_file);
   } else if (cls->GetDexTypeIndex() == DexFile::kDexNoIndex16) {
-    DCHECK(cls->IsProxyClass()) << PrettyClass(cls);
+    DCHECK(cls->IsProxyClass()) << cls->PrettyClass();
     // TODO: deal with proxy classes.
   } else if (IsSameDexFile(cls->GetDexFile(), dex_file)) {
     DCHECK_EQ(cls->GetDexCache(), dex_cache.Get());
@@ -266,7 +266,7 @@
   ScopedObjectAccess soa(Thread::Current());
   uint32_t method_index = invoke_instruction->GetDexMethodIndex();
   const DexFile& caller_dex_file = *caller_compilation_unit_.GetDexFile();
-  VLOG(compiler) << "Try inlining " << PrettyMethod(method_index, caller_dex_file);
+  VLOG(compiler) << "Try inlining " << caller_dex_file.PrettyMethod(method_index);
 
   // We can query the dex cache directly. The verifier has populated it already.
   ArtMethod* resolved_method = invoke_instruction->GetResolvedMethod();
@@ -304,7 +304,7 @@
       const InlineCache& ic = *profiling_info->GetInlineCache(invoke_instruction->GetDexPc());
       if (ic.IsUninitialized()) {
         VLOG(compiler) << "Interface or virtual call to "
-                       << PrettyMethod(method_index, caller_dex_file)
+                       << caller_dex_file.PrettyMethod(method_index)
                        << " is not hit and not inlined";
         return false;
       } else if (ic.IsMonomorphic()) {
@@ -322,7 +322,7 @@
       } else {
         DCHECK(ic.IsMegamorphic());
         VLOG(compiler) << "Interface or virtual call to "
-                       << PrettyMethod(method_index, caller_dex_file)
+                       << caller_dex_file.PrettyMethod(method_index)
                        << " is megamorphic and not inlined";
         MaybeRecordStat(kMegamorphicCall);
         return false;
@@ -331,7 +331,7 @@
   }
 
   VLOG(compiler) << "Interface or virtual call to "
-                 << PrettyMethod(method_index, caller_dex_file)
+                 << caller_dex_file.PrettyMethod(method_index)
                  << " could not be statically determined";
   return false;
 }
@@ -366,7 +366,7 @@
   uint32_t class_index = FindClassIndexIn(
       ic.GetMonomorphicType(), caller_dex_file, caller_compilation_unit_.GetDexCache());
   if (class_index == DexFile::kDexNoIndex) {
-    VLOG(compiler) << "Call to " << PrettyMethod(resolved_method)
+    VLOG(compiler) << "Call to " << ArtMethod::PrettyMethod(resolved_method)
                    << " from inline cache is not inlined because its class is not"
                    << " accessible to the caller";
     return false;
@@ -526,7 +526,7 @@
   }
 
   if (!one_target_inlined) {
-    VLOG(compiler) << "Call to " << PrettyMethod(resolved_method)
+    VLOG(compiler) << "Call to " << ArtMethod::PrettyMethod(resolved_method)
                    << " from inline cache is not inlined because none"
                    << " of its targets could be inlined";
     return false;
@@ -660,7 +660,7 @@
       actual_method = new_method;
     } else if (actual_method != new_method) {
       // Different methods, bailout.
-      VLOG(compiler) << "Call to " << PrettyMethod(resolved_method)
+      VLOG(compiler) << "Call to " << ArtMethod::PrettyMethod(resolved_method)
                      << " from inline cache is not inlined because it resolves"
                      << " to different methods";
       return false;
@@ -794,7 +794,7 @@
                                  ArtMethod* method,
                                  HInstruction** return_replacement) {
   if (method->IsProxyMethod()) {
-    VLOG(compiler) << "Method " << PrettyMethod(method)
+    VLOG(compiler) << "Method " << method->PrettyMethod()
                    << " is not inlined because of unimplemented inline support for proxy methods.";
     return false;
   }
@@ -804,11 +804,12 @@
   if (!compiler_driver_->MayInline(method->GetDexFile(),
                                    outer_compilation_unit_.GetDexFile())) {
     if (TryPatternSubstitution(invoke_instruction, method, return_replacement)) {
-      VLOG(compiler) << "Successfully replaced pattern of invoke " << PrettyMethod(method);
+      VLOG(compiler) << "Successfully replaced pattern of invoke "
+                     << method->PrettyMethod();
       MaybeRecordStat(kReplacedInvokeWithSimplePattern);
       return true;
     }
-    VLOG(compiler) << "Won't inline " << PrettyMethod(method) << " in "
+    VLOG(compiler) << "Won't inline " << method->PrettyMethod() << " in "
                    << outer_compilation_unit_.GetDexFile()->GetLocation() << " ("
                    << caller_compilation_unit_.GetDexFile()->GetLocation() << ") from "
                    << method->GetDexFile()->GetLocation();
@@ -820,14 +821,14 @@
   const DexFile::CodeItem* code_item = method->GetCodeItem();
 
   if (code_item == nullptr) {
-    VLOG(compiler) << "Method " << PrettyMethod(method)
+    VLOG(compiler) << "Method " << method->PrettyMethod()
                    << " is not inlined because it is native";
     return false;
   }
 
   size_t inline_max_code_units = compiler_driver_->GetCompilerOptions().GetInlineMaxCodeUnits();
   if (code_item->insns_size_in_code_units_ > inline_max_code_units) {
-    VLOG(compiler) << "Method " << PrettyMethod(method)
+    VLOG(compiler) << "Method " << method->PrettyMethod()
                    << " is too big to inline: "
                    << code_item->insns_size_in_code_units_
                    << " > "
@@ -836,13 +837,13 @@
   }
 
   if (code_item->tries_size_ != 0) {
-    VLOG(compiler) << "Method " << PrettyMethod(method)
+    VLOG(compiler) << "Method " << method->PrettyMethod()
                    << " is not inlined because of try block";
     return false;
   }
 
   if (!method->IsCompilable()) {
-    VLOG(compiler) << "Method " << PrettyMethod(method)
+    VLOG(compiler) << "Method " << method->PrettyMethod()
                    << " has soft failures un-handled by the compiler, so it cannot be inlined";
   }
 
@@ -851,7 +852,7 @@
     if (Runtime::Current()->UseJitCompilation() ||
         !compiler_driver_->IsMethodVerifiedWithoutFailures(
             method->GetDexMethodIndex(), class_def_idx, *method->GetDexFile())) {
-      VLOG(compiler) << "Method " << PrettyMethod(method)
+      VLOG(compiler) << "Method " << method->PrettyMethod()
                      << " couldn't be verified, so it cannot be inlined";
       return false;
     }
@@ -861,7 +862,7 @@
       invoke_instruction->AsInvokeStaticOrDirect()->IsStaticWithImplicitClinitCheck()) {
     // Case of a static method that cannot be inlined because it implicitly
     // requires an initialization check of its declaring class.
-    VLOG(compiler) << "Method " << PrettyMethod(method)
+    VLOG(compiler) << "Method " << method->PrettyMethod()
                    << " is not inlined because it is static and requires a clinit"
                    << " check that cannot be emitted due to Dex cache limitations";
     return false;
@@ -871,7 +872,7 @@
     return false;
   }
 
-  VLOG(compiler) << "Successfully inlined " << PrettyMethod(method);
+  VLOG(compiler) << "Successfully inlined " << method->PrettyMethod();
   MaybeRecordStat(kInlinedInvoke);
   return true;
 }
@@ -1143,14 +1144,14 @@
                         handles_);
 
   if (builder.BuildGraph() != kAnalysisSuccess) {
-    VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+    VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                    << " could not be built, so cannot be inlined";
     return false;
   }
 
   if (!RegisterAllocator::CanAllocateRegistersFor(*callee_graph,
                                                   compiler_driver_->GetInstructionSet())) {
-    VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+    VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                    << " cannot be inlined because of the register allocator";
     return false;
   }
@@ -1200,7 +1201,7 @@
   // a throw predecessor.
   HBasicBlock* exit_block = callee_graph->GetExitBlock();
   if (exit_block == nullptr) {
-    VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+    VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                    << " could not be inlined because it has an infinite loop";
     return false;
   }
@@ -1213,7 +1214,7 @@
     }
   }
   if (has_throw_predecessor) {
-    VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+    VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                    << " could not be inlined because one branch always throws";
     return false;
   }
@@ -1231,7 +1232,7 @@
     if (block->IsLoopHeader() && block->GetLoopInformation()->IsIrreducible()) {
       // Don't inline methods with irreducible loops, they could prevent some
       // optimizations to run.
-      VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+      VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                      << " could not be inlined because it contains an irreducible loop";
       return false;
     }
@@ -1240,28 +1241,28 @@
          !instr_it.Done();
          instr_it.Advance()) {
       if (number_of_instructions++ == number_of_instructions_budget) {
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " is not inlined because its caller has reached"
                        << " its instruction budget limit.";
         return false;
       }
       HInstruction* current = instr_it.Current();
       if (!can_inline_environment && current->NeedsEnvironment()) {
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " is not inlined because its caller has reached"
                        << " its environment budget limit.";
         return false;
       }
 
       if (!same_dex_file && current->NeedsEnvironment()) {
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " could not be inlined because " << current->DebugName()
                        << " needs an environment and is in a different dex file";
         return false;
       }
 
       if (!same_dex_file && current->NeedsDexCacheOfDeclaringClass()) {
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " could not be inlined because " << current->DebugName()
                        << " it is in a different dex file and requires access to the dex cache";
         return false;
@@ -1269,7 +1270,7 @@
 
       if (current->IsNewInstance() &&
           (current->AsNewInstance()->GetEntrypoint() == kQuickAllocObjectWithAccessCheck)) {
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " could not be inlined because it is using an entrypoint"
                        << " with access checks";
         // Allocation entrypoint does not handle inlined frames.
@@ -1278,7 +1279,7 @@
 
       if (current->IsNewArray() &&
           (current->AsNewArray()->GetEntrypoint() == kQuickAllocArrayWithAccessCheck)) {
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " could not be inlined because it is using an entrypoint"
                        << " with access checks";
         // Allocation entrypoint does not handle inlined frames.
@@ -1290,7 +1291,7 @@
           current->IsUnresolvedStaticFieldSet() ||
           current->IsUnresolvedInstanceFieldSet()) {
         // Entrypoint for unresolved fields does not handle inlined frames.
-        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
+        VLOG(compiler) << "Method " << callee_dex_file.PrettyMethod(method_index)
                        << " could not be inlined because it is using an unresolved"
                        << " entrypoint";
         return false;
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index f7d67db..613e008 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1065,7 +1065,7 @@
       // reject any class where this is violated. However, the verifier only does these checks
       // on non trivially dead instructions, so we just bailout the compilation.
       VLOG(compiler) << "Did not compile "
-                     << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_)
+                     << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
                      << " because of non-sequential dex register pair in wide argument";
       MaybeRecordStat(MethodCompilationStat::kNotCompiledMalformedOpcode);
       return false;
@@ -1079,7 +1079,7 @@
 
   if (*argument_index != invoke->GetNumberOfArguments()) {
     VLOG(compiler) << "Did not compile "
-                   << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_)
+                   << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
                    << " because of wrong number of arguments in invoke instruction";
     MaybeRecordStat(MethodCompilationStat::kNotCompiledMalformedOpcode);
     return false;
@@ -2716,7 +2716,7 @@
 
     default:
       VLOG(compiler) << "Did not compile "
-                     << PrettyMethod(dex_compilation_unit_->GetDexMethodIndex(), *dex_file_)
+                     << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
                      << " because of unhandled instruction "
                      << instruction.Name();
       MaybeRecordStat(MethodCompilationStat::kNotCompiledUnhandledInstruction);
diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc
index 412ccfc..8327a4c 100644
--- a/compiler/optimizing/intrinsics.cc
+++ b/compiler/optimizing/intrinsics.cc
@@ -146,7 +146,7 @@
           if (!CheckInvokeType(intrinsic, invoke)) {
             LOG(WARNING) << "Found an intrinsic with unexpected invoke type: "
                 << intrinsic << " for "
-                << PrettyMethod(invoke->GetDexMethodIndex(), invoke->GetDexFile())
+                << invoke->GetDexFile().PrettyMethod(invoke->GetDexMethodIndex())
                 << invoke->DebugName();
           } else {
             invoke->SetIntrinsic(intrinsic,
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 1e69966..59cc009 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -2295,7 +2295,7 @@
   ScopedObjectAccess soa(Thread::Current());
   os << "["
      << " is_valid=" << rhs.IsValid()
-     << " type=" << (!rhs.IsValid() ? "?" : PrettyClass(rhs.GetTypeHandle().Get()))
+     << " type=" << (!rhs.IsValid() ? "?" : mirror::Class::PrettyClass(rhs.GetTypeHandle().Get()))
      << " is_exact=" << rhs.IsExact()
      << " ]";
   return os;
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 4370a84..6ba0963 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -173,7 +173,7 @@
   const char* GetMethodName() {
     // PrettyMethod() is expensive, so we delay calling it until we actually have to.
     if (cached_method_name_.empty()) {
-      cached_method_name_ = PrettyMethod(graph_->GetMethodIdx(), graph_->GetDexFile());
+      cached_method_name_ = graph_->GetDexFile().PrettyMethod(graph_->GetMethodIdx());
     }
     return cached_method_name_.c_str();
   }
@@ -1044,7 +1044,7 @@
       if (kArenaAllocatorCountAllocations) {
         if (arena.BytesAllocated() > kArenaAllocatorMemoryReportThreshold) {
           MemStats mem_stats(arena.GetMemStats());
-          LOG(INFO) << PrettyMethod(method_idx, dex_file) << " " << Dumpable<MemStats>(mem_stats);
+          LOG(INFO) << dex_file.PrettyMethod(method_idx) << " " << Dumpable<MemStats>(mem_stats);
         }
       }
     }
@@ -1066,7 +1066,7 @@
     // instruction set is supported -- and has support for read
     // barriers, if they are enabled). This makes sure we're not
     // regressing.
-    std::string method_name = PrettyMethod(method_idx, dex_file);
+    std::string method_name = dex_file.PrettyMethod(method_idx);
     bool shouldCompile = method_name.find("$opt$") != std::string::npos;
     DCHECK((method != nullptr) || !shouldCompile) << "Didn't compile " << method_name;
   }
@@ -1131,7 +1131,7 @@
     if (kArenaAllocatorCountAllocations) {
       if (arena.BytesAllocated() > kArenaAllocatorMemoryReportThreshold) {
         MemStats mem_stats(arena.GetMemStats());
-        LOG(INFO) << PrettyMethod(method_idx, *dex_file) << " " << Dumpable<MemStats>(mem_stats);
+        LOG(INFO) << dex_file->PrettyMethod(method_idx) << " " << Dumpable<MemStats>(mem_stats);
       }
     }
   }
diff --git a/compiler/optimizing/prepare_for_register_allocation.cc b/compiler/optimizing/prepare_for_register_allocation.cc
index 8fb5396..a4df9e5 100644
--- a/compiler/optimizing/prepare_for_register_allocation.cc
+++ b/compiler/optimizing/prepare_for_register_allocation.cc
@@ -44,7 +44,7 @@
     // Add a fake environment for String.charAt() inline info as we want
     // the exception to appear as being thrown from there.
     const DexFile& dex_file = check->GetEnvironment()->GetDexFile();
-    DCHECK_STREQ(PrettyMethod(check->GetStringCharAtMethodIndex(), dex_file).c_str(),
+    DCHECK_STREQ(dex_file.PrettyMethod(check->GetStringCharAtMethodIndex()).c_str(),
                  "char java.lang.String.charAt(int)");
     ArenaAllocator* arena = GetGraph()->GetArena();
     HEnvironment* environment = new (arena) HEnvironment(arena,
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc
index 83698ad..b16c3ea 100644
--- a/compiler/optimizing/reference_type_propagation.cc
+++ b/compiler/optimizing/reference_type_propagation.cc
@@ -448,9 +448,9 @@
       mirror::Class* declaring_class = method->GetDeclaringClass();
       DCHECK(declaring_class != nullptr);
       DCHECK(declaring_class->IsStringClass())
-          << "Expected String class: " << PrettyDescriptor(declaring_class);
+          << "Expected String class: " << declaring_class->PrettyDescriptor();
       DCHECK(method->IsConstructor())
-          << "Expected String.<init>: " << PrettyMethod(method);
+          << "Expected String.<init>: " << method->PrettyMethod();
     }
     instr->SetReferenceTypeInfo(
         ReferenceTypeInfo::Create(handle_cache_->GetStringClassHandle(), /* is_exact */ true));