From b0d5fc0ac139da4aaa1440263416b9bde05630b0 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 15 Jul 2015 14:41:29 +0100 Subject: Fixes and improvements in ReferenceTypePropagation - Bound object types after a CheckCast. This increases the precision of (inlining) generic operations. - Make sure that the BoundType is exact when the class is final. - Make sure that we don't duplicate BoundTypes when we run the analysis more than once. Change-Id: Ic22b610766fae101f942c0d753ddcac32ac1844a --- compiler/optimizing/graph_visualizer.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/graph_visualizer.cc') diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 37c060c1b1..aaf7a6d8f5 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -397,6 +397,11 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { return strcmp(pass_name_, name) == 0; } + bool IsReferenceTypePropagationPass() { + return strstr(pass_name_, ReferenceTypePropagation::kReferenceTypePropagationPassName) + != nullptr; + } + void PrintInstruction(HInstruction* instruction) { output_ << instruction->DebugName(); if (instruction->InputCount() > 0) { @@ -460,14 +465,13 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { } else { StartAttributeStream("loop") << "B" << info->GetHeader()->GetBlockId(); } - } else if (IsPass(ReferenceTypePropagation::kReferenceTypePropagationPassName) - && is_after_pass_) { + } else if (IsReferenceTypePropagationPass() && is_after_pass_) { if (instruction->GetType() == Primitive::kPrimNot) { if (instruction->IsLoadClass()) { ReferenceTypeInfo info = instruction->AsLoadClass()->GetLoadedClassRTI(); ScopedObjectAccess soa(Thread::Current()); if (info.GetTypeHandle().GetReference() != nullptr) { - StartAttributeStream("klass") << PrettyClass(info.GetTypeHandle().Get()); + StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); } else { StartAttributeStream("klass") << "unresolved"; } @@ -477,7 +481,7 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { StartAttributeStream("klass") << "java.lang.Object"; } else { ScopedObjectAccess soa(Thread::Current()); - StartAttributeStream("klass") << PrettyClass(info.GetTypeHandle().Get()); + StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); } StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha; } -- cgit v1.2.3