Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
| index 7b8e997150c84ea4da8d6cf68d74312d98a54121..0a1ecbc6d57b629cabe5b4c895a90b3d23497f99 100644 |
| --- a/runtime/vm/intermediate_language.cc |
| +++ b/runtime/vm/intermediate_language.cc |
| @@ -1821,7 +1821,16 @@ Instruction* BranchInstr::Canonicalize(FlowGraphOptimizer* optimizer) { |
| Definition* replacement = comparison()->Canonicalize(optimizer); |
| if (replacement == comparison() || replacement == NULL) return this; |
| ComparisonInstr* comp = replacement->AsComparison(); |
| - if (comp == NULL) return this; |
| + if ((comp == NULL) || comp->CanDeoptimize()) return this; |
| + |
| + // Check that comparison is not serving as a pending deoptimization target |
| + // for conversions. |
| + for (intptr_t i = 0; i < comp->InputCount(); i++) { |
| + if (comp->RequiredInputRepresentation(i) != |
| + comp->InputAt(i)->definition()->representation()) { |
|
Florian Schneider
2013/02/13 14:08:43
Indentation off.
Vyacheslav Egorov (Google)
2013/02/13 14:10:19
Done.
|
| + return this; |
| + } |
| + } |
| // Replace the comparison if the replacement is used at this branch, |
| // and has exactly one use. |