Index: src/hydrogen-infer-representation.cc |
diff --git a/src/hydrogen-infer-representation.cc b/src/hydrogen-infer-representation.cc |
index 95c341285ccb1a5fd6b37ffac5f1c3bbc540a758..1b3ab6ffbb2d814b31c65fded335c0ba7c429892 100644 |
--- a/src/hydrogen-infer-representation.cc |
+++ b/src/hydrogen-infer-representation.cc |
@@ -82,24 +82,36 @@ void HInferRepresentationPhase::Run() { |
if (done.Contains(i)) continue; |
// Check if all uses of all connected phis in this group are truncating. |
- bool all_uses_everywhere_truncating = true; |
+ bool all_uses_everywhere_truncating_int32 = true; |
+ bool all_uses_everywhere_truncating_smi = true; |
for (BitVector::Iterator it(connected_phis[i]); |
!it.Done(); |
it.Advance()) { |
int index = it.Current(); |
- all_uses_everywhere_truncating &= |
+ all_uses_everywhere_truncating_int32 &= |
phi_list->at(index)->CheckFlag(HInstruction::kTruncatingToInt32); |
+ all_uses_everywhere_truncating_smi &= |
+ phi_list->at(index)->CheckFlag(HInstruction::kTruncatingToSmi); |
done.Add(index); |
} |
- if (all_uses_everywhere_truncating) { |
- continue; // Great, nothing to do. |
+ |
+ if (!all_uses_everywhere_truncating_int32) { |
+ // Clear truncation flag of this group of connected phis. |
+ for (BitVector::Iterator it(connected_phis[i]); |
+ !it.Done(); |
+ it.Advance()) { |
+ int index = it.Current(); |
+ phi_list->at(index)->ClearFlag(HInstruction::kTruncatingToInt32); |
+ } |
} |
- // Clear truncation flag of this group of connected phis. |
- for (BitVector::Iterator it(connected_phis[i]); |
- !it.Done(); |
- it.Advance()) { |
- int index = it.Current(); |
- phi_list->at(index)->ClearFlag(HInstruction::kTruncatingToInt32); |
+ if (!all_uses_everywhere_truncating_smi) { |
+ // Clear truncation flag of this group of connected phis. |
+ for (BitVector::Iterator it(connected_phis[i]); |
+ !it.Done(); |
+ it.Advance()) { |
+ int index = it.Current(); |
+ phi_list->at(index)->ClearFlag(HInstruction::kTruncatingToSmi); |
+ } |
} |
} |
} |