diff options
author | 2015-07-16 16:51:30 +0100 | |
---|---|---|
committer | 2015-07-21 14:33:42 +0100 | |
commit | 3fabec7a25d151b26ba7de13615bbead0dd615a6 (patch) | |
tree | a73af9489665d5b033e961d1aafe7e0935c8af85 /compiler/optimizing/graph_visualizer.cc | |
parent | b0d5fc0ac139da4aaa1440263416b9bde05630b0 (diff) |
Use the object class as top in reference type propagation
This properly types all instructions, making it safe to query the type
at any time.
This also moves a few functions from class.h to class-inl.h to please
gcc linker when compiling for target.
Change-Id: I6b7ce965c10834c994b95529ab65a548515b4406
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
-rw-r--r-- | compiler/optimizing/graph_visualizer.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index aaf7a6d8f5..bc9631b250 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -470,19 +470,14 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { if (instruction->IsLoadClass()) { ReferenceTypeInfo info = instruction->AsLoadClass()->GetLoadedClassRTI(); ScopedObjectAccess soa(Thread::Current()); - if (info.GetTypeHandle().GetReference() != nullptr) { - StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); - } else { - StartAttributeStream("klass") << "unresolved"; - } + DCHECK(info.IsValid()) << "Invalid RTI for " << instruction->DebugName(); + StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); + StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha; } else { ReferenceTypeInfo info = instruction->GetReferenceTypeInfo(); - if (info.IsTop()) { - StartAttributeStream("klass") << "java.lang.Object"; - } else { - ScopedObjectAccess soa(Thread::Current()); - StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); - } + ScopedObjectAccess soa(Thread::Current()); + DCHECK(info.IsValid()) << "Invalid RTI for " << instruction->DebugName(); + StartAttributeStream("klass") << PrettyDescriptor(info.GetTypeHandle().Get()); StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha; } } |