diff options
author | Calin Juravle <calin@google.com> | 2015-07-15 14:41:29 +0100 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2015-07-21 14:33:33 +0100 |
commit | b0d5fc0ac139da4aaa1440263416b9bde05630b0 (patch) | |
tree | 7f897d8b0545e43da6b6059718685a8e396b3b70 /compiler/optimizing/graph_visualizer.cc | |
parent | d1665b7a689086ec5b33a69a05313c46ea1a95e4 (diff) |
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
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
-rw-r--r-- | compiler/optimizing/graph_visualizer.cc | 12 |
1 files changed, 8 insertions, 4 deletions
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; } |