Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
| index 4841d52bf78706b067438d41f7a89f1c3271d31d..5e4ebf78f294ff112d3353f0917e45fa10681bcf 100644 |
| --- a/runtime/vm/flow_graph_optimizer.cc |
| +++ b/runtime/vm/flow_graph_optimizer.cc |
| @@ -6051,8 +6051,8 @@ void ConstantPropagator::VisitEqualityCompare(EqualityCompareInstr* instr) { |
| RawObject::IsIntegerClassId(instr->operation_cid())) { |
| return SetValue(instr, |
| (instr->kind() == Token::kEQ) |
| - ? Bool::True() |
| - : Bool::False()); |
| + ? Bool::True() |
| + : Bool::False()); |
| } |
| } |
| @@ -6064,6 +6064,12 @@ void ConstantPropagator::VisitEqualityCompare(EqualityCompareInstr* instr) { |
| Integer::Cast(left), |
| Integer::Cast(right)); |
| SetValue(instr, result ? Bool::True() : Bool::False()); |
| + } else if (left.IsString() && right.IsString()) { |
|
srdjan
2013/08/26 16:00:39
I believe all constant strings must be canonicaliz
|
| + const bool result = String::Cast(left).Equals(String::Cast(right)); |
| + SetValue(instr, |
| + ((instr->kind() == Token::kEQ) == result) |
| + ? Bool::True() |
| + : Bool::False()); |
| } else { |
| SetValue(instr, non_constant_); |
| } |