Fix bug in optimizing around instanceof.
We were too aggressive when removing instanceof. We should
not remove it when there is one of the two static types that
is an interface.
Change-Id: I1fd80915b99b094f7b4393e7adb2b160201b30d5
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc
index fd2e4e8..b647917 100644
--- a/compiler/optimizing/graph_visualizer.cc
+++ b/compiler/optimizing/graph_visualizer.cc
@@ -21,6 +21,7 @@
#include "licm.h"
#include "nodes.h"
#include "optimization.h"
+#include "reference_type_propagation.h"
#include "register_allocator.h"
#include "ssa_liveness_analysis.h"
@@ -354,6 +355,24 @@
} else {
StartAttributeStream("loop") << "B" << info->GetHeader()->GetBlockId();
}
+ } else if (IsPass(ReferenceTypePropagation::kReferenceTypePropagationPassName)
+ && is_after_pass_) {
+ if (instruction->GetType() == Primitive::kPrimNot) {
+ if (instruction->IsLoadClass()) {
+ ScopedObjectAccess soa(Thread::Current());
+ StartAttributeStream("klass")
+ << PrettyClass(instruction->AsLoadClass()->GetLoadedClassRTI().GetTypeHandle().Get());
+ } else {
+ ReferenceTypeInfo info = instruction->GetReferenceTypeInfo();
+ if (info.IsTop()) {
+ StartAttributeStream("klass") << "java.lang.Object";
+ } else {
+ ScopedObjectAccess soa(Thread::Current());
+ StartAttributeStream("klass") << PrettyClass(info.GetTypeHandle().Get());
+ }
+ StartAttributeStream("exact") << std::boolalpha << info.IsExact() << std::noboolalpha;
+ }
+ }
}
}