From 5ceac0e41bdf8d486f978c43800f493bce83f5d4 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 26 Jun 2017 13:19:09 +0100 Subject: Don't use the graph's dex file when printing HInvoke. It's not the right dex file if the invokes come from inlined methods. Test: manual Change-Id: I4e3fb35e2bddc67510c39e12075c9a5ca0498a3a --- compiler/optimizing/graph_visualizer.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 7dcf2440b2..a20ec3c0db 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -451,8 +451,16 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { void VisitInvoke(HInvoke* invoke) OVERRIDE { StartAttributeStream("dex_file_index") << invoke->GetDexMethodIndex(); - StartAttributeStream("method_name") << GetGraph()->GetDexFile().PrettyMethod( - invoke->GetDexMethodIndex(), /* with_signature */ false); + ArtMethod* method = invoke->GetResolvedMethod(); + // We don't print signatures, which conflict with c1visualizer format. + static constexpr bool kWithSignature = false; + // Note that we can only use the graph's dex file for the unresolved case. The + // other invokes might be coming from inlined methods. + ScopedObjectAccess soa(Thread::Current()); + std::string method_name = (method == nullptr) + ? GetGraph()->GetDexFile().PrettyMethod(invoke->GetDexMethodIndex(), kWithSignature) + : method->PrettyMethod(kWithSignature); + StartAttributeStream("method_name") << method_name; } void VisitInvokeUnresolved(HInvokeUnresolved* invoke) OVERRIDE { -- cgit v1.2.3