summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2015-06-29 11:43:16 +0000
committer Calin Juravle <calin@google.com> 2015-06-29 11:43:16 +0000
commit63107a804ce17db9789051e1fe310d99d1dae1cb (patch)
tree6c63aac8871de4143ee37f2a513023f1247b2117 /compiler/optimizing
parent30eb58c548bee08468f68eb140a74a51dd7d9b43 (diff)
Revert "Do not update the type of something we already know."
This reverts commit 30eb58c548bee08468f68eb140a74a51dd7d9b43. Change-Id: Icd959e868160fc3ee7031dd2927554ac5b21d40f
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/graph_checker.cc26
-rw-r--r--compiler/optimizing/graph_checker.h4
-rw-r--r--compiler/optimizing/graph_visualizer.cc2
-rw-r--r--compiler/optimizing/reference_type_propagation.cc9
4 files changed, 1 insertions, 40 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 9679d0ab70..d7e6bd8161 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -257,7 +257,6 @@ void GraphChecker::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) {
}
void GraphChecker::VisitReturn(HReturn* ret) {
- VisitInstruction(ret);
if (!ret->GetBlock()->GetSingleSuccessor()->IsExitBlock()) {
AddError(StringPrintf("%s:%d does not jump to the exit block.",
ret->DebugName(),
@@ -266,7 +265,6 @@ void GraphChecker::VisitReturn(HReturn* ret) {
}
void GraphChecker::VisitReturnVoid(HReturnVoid* ret) {
- VisitInstruction(ret);
if (!ret->GetBlock()->GetSingleSuccessor()->IsExitBlock()) {
AddError(StringPrintf("%s:%d does not jump to the exit block.",
ret->DebugName(),
@@ -274,30 +272,6 @@ void GraphChecker::VisitReturnVoid(HReturnVoid* ret) {
}
}
-void GraphChecker::VisitCheckCast(HCheckCast* check) {
- VisitInstruction(check);
- HInstruction* input = check->InputAt(1);
- if (!input->IsLoadClass()) {
- AddError(StringPrintf("%s:%d expects a HLoadClass as second input, not %s:%d.",
- check->DebugName(),
- check->GetId(),
- input->DebugName(),
- input->GetId()));
- }
-}
-
-void GraphChecker::VisitInstanceOf(HInstanceOf* instruction) {
- VisitInstruction(instruction);
- HInstruction* input = instruction->InputAt(1);
- if (!input->IsLoadClass()) {
- AddError(StringPrintf("%s:%d expects a HLoadClass as second input, not %s:%d.",
- instruction->DebugName(),
- instruction->GetId(),
- input->DebugName(),
- input->GetId()));
- }
-}
-
void SSAChecker::VisitBasicBlock(HBasicBlock* block) {
super_type::VisitBasicBlock(block);
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h
index 7c72e23e2d..bafa69d422 100644
--- a/compiler/optimizing/graph_checker.h
+++ b/compiler/optimizing/graph_checker.h
@@ -48,10 +48,6 @@ class GraphChecker : public HGraphDelegateVisitor {
// Check that the HasBoundsChecks() flag is set for bounds checks.
void VisitBoundsCheck(HBoundsCheck* check) OVERRIDE;
- // Check that HCheckCast and HInstanceOf have HLoadClass as second input.
- void VisitCheckCast(HCheckCast* check) OVERRIDE;
- void VisitInstanceOf(HInstanceOf* check) OVERRIDE;
-
// Check that the Return and ReturnVoid jump to the exit block.
void VisitReturn(HReturn* ret) OVERRIDE;
void VisitReturnVoid(HReturnVoid* ret) OVERRIDE;
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc
index c41574c93c..30d61ef040 100644
--- a/compiler/optimizing/graph_visualizer.cc
+++ b/compiler/optimizing/graph_visualizer.cc
@@ -462,7 +462,7 @@ class HGraphVisualizerPrinter : public HGraphVisitor {
ReferenceTypeInfo info = instruction->AsLoadClass()->GetLoadedClassRTI();
ScopedObjectAccess soa(Thread::Current());
if (info.GetTypeHandle().GetReference() != nullptr) {
- StartAttributeStream("klass") << PrettyClass(info.GetTypeHandle().Get());
+ StartAttributeStream("klass") << info.GetTypeHandle().Get();
} else {
StartAttributeStream("klass") << "unresolved";
}
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc
index 3d6606b8dc..67840984b1 100644
--- a/compiler/optimizing/reference_type_propagation.cc
+++ b/compiler/optimizing/reference_type_propagation.cc
@@ -151,15 +151,6 @@ void ReferenceTypePropagation::BoundTypeForIfInstanceOf(HBasicBlock* block) {
HBoundType* bound_type = nullptr;
HInstruction* obj = instanceOf->InputAt(0);
- if (obj->GetReferenceTypeInfo().IsExact() && !obj->IsPhi()) {
- // This method is being called while doing a fixed-point calculation
- // over phis. Non-phis instruction whose type is already known do
- // not need to be bound to another type.
- // Not that this also prevents replacing `HLoadClass` with a `HBoundType`.
- // `HCheckCast` and `HInstanceOf` expect a `HLoadClass` as a second
- // input.
- return;
- }
for (HUseIterator<HInstruction*> it(obj->GetUses()); !it.Done(); it.Advance()) {
HInstruction* user = it.Current()->GetUser();
if (instanceOfTrueBlock->Dominates(user->GetBlock())) {