Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index b473f58933d2975a9430e0368c16a88e02889d3a..6655187f677624c3efb685558433618fce8b07cf 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -3247,7 +3247,11 @@ void HGraph::MarkDeoptimizeOnUndefined() { |
HPhi* phi = phi_list()->at(i); |
if (phi->representation().IsDouble()) { |
for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { |
- if (it.value()->CheckFlag(HValue::kDeoptimizeOnUndefined)) { |
+ int use_index = it.index(); |
+ HValue* use_value = it.value(); |
+ Representation req = use_value->RequiredInputRepresentation(use_index); |
+ if (!req.IsDouble() || |
+ use_value->CheckFlag(HValue::kDeoptimizeOnUndefined)) { |
RecursivelyMarkPhiDeoptimizeOnUndefined(phi); |
break; |
} |
@@ -3988,8 +3992,8 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) { |
// This must happen after inferring representations. |
MergeRemovableSimulates(); |
- InsertRepresentationChanges(); |
MarkDeoptimizeOnUndefined(); |
+ InsertRepresentationChanges(); |
InitializeInferredTypes(); |