Chromium Code Reviews| Index: runtime/vm/flow_graph_builder.cc |
| diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc |
| index 265c3088f86794e090dc8e8031afc7559b43efc2..e37b84cadc55be837a520e2b43963bf7688165dd 100644 |
| --- a/runtime/vm/flow_graph_builder.cc |
| +++ b/runtime/vm/flow_graph_builder.cc |
| @@ -991,23 +991,8 @@ void TestGraphVisitor::ReturnValue(Value* value) { |
| } |
| -void TestGraphVisitor::MergeBranchWithComparison(ComparisonInstr* comp) { |
| - BranchInstr* branch; |
| - if (Token::IsStrictEqualityOperator(comp->kind())) { |
| - ASSERT(comp->IsStrictCompare()); |
| - branch = new (Z) BranchInstr(comp); |
| - } else if (Token::IsEqualityOperator(comp->kind()) && |
| - (comp->left()->BindsToConstantNull() || |
| - comp->right()->BindsToConstantNull())) { |
| - branch = new (Z) BranchInstr(new (Z) StrictCompareInstr( |
| - comp->token_pos(), |
| - (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT, |
| - comp->left(), comp->right(), |
| - false)); // No number check. |
| - } else { |
| - branch = new (Z) BranchInstr(comp); |
| - branch->set_is_checked(Isolate::Current()->type_checks()); |
| - } |
| +void TestGraphVisitor::MergeBranchWithStrictCompare(StrictCompareInstr* comp) { |
| + BranchInstr* branch = new (Z) BranchInstr(comp); |
| AddInstruction(branch); |
| CloseFragment(); |
| true_successor_addresses_.Add(branch->true_successor_address()); |
| @@ -1030,9 +1015,10 @@ void TestGraphVisitor::MergeBranchWithNegate(BooleanNegateInstr* neg) { |
| void TestGraphVisitor::ReturnDefinition(Definition* definition) { |
| - ComparisonInstr* comp = definition->AsComparison(); |
| + RELEASE_ASSERT(definition->IsStrictCompare() || !definition->IsComparison()); |
|
Florian Schneider
2017/01/18 22:31:18
ASSERT should be enough if you confirmed for all c
Vyacheslav Egorov (Google)
2017/01/18 22:35:11
Sorry this was left from some experimental runs
|
| + StrictCompareInstr* comp = definition->AsStrictCompare(); |
| if (comp != NULL) { |
| - MergeBranchWithComparison(comp); |
| + MergeBranchWithStrictCompare(comp); |
| return; |
| } |
| if (!Isolate::Current()->type_checks()) { |