Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: runtime/vm/flow_graph_range_analysis.cc

Issue 2074533002: Simplify and improve optimization of is-tests in the precompiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_range_analysis.h" 5 #include "vm/flow_graph_range_analysis.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/il_printer.h" 8 #include "vm/il_printer.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 if (target == NULL) { 1562 if (target == NULL) {
1563 // TODO(vegorov): replace Constraint with an uncoditional 1563 // TODO(vegorov): replace Constraint with an uncoditional
1564 // deoptimization and kill all dominated dead code. 1564 // deoptimization and kill all dominated dead code.
1565 continue; 1565 continue;
1566 } 1566 }
1567 1567
1568 BranchInstr* branch = 1568 BranchInstr* branch =
1569 target->PredecessorAt(0)->last_instruction()->AsBranch(); 1569 target->PredecessorAt(0)->last_instruction()->AsBranch();
1570 if (target == branch->true_successor()) { 1570 if (target == branch->true_successor()) {
1571 // True unreachable. 1571 // True unreachable.
1572 if (FLAG_trace_constant_propagation) { 1572 if (FLAG_trace_constant_propagation &&
1573 FlowGraphPrinter::ShouldPrint(flow_graph_->function())) {
1573 THR_Print("Range analysis: True unreachable (B%" Pd ")\n", 1574 THR_Print("Range analysis: True unreachable (B%" Pd ")\n",
1574 branch->true_successor()->block_id()); 1575 branch->true_successor()->block_id());
1575 } 1576 }
1576 branch->set_constant_target(branch->false_successor()); 1577 branch->set_constant_target(branch->false_successor());
1577 } else { 1578 } else {
1578 ASSERT(target == branch->false_successor()); 1579 ASSERT(target == branch->false_successor());
1579 // False unreachable. 1580 // False unreachable.
1580 if (FLAG_trace_constant_propagation) { 1581 if (FLAG_trace_constant_propagation &&
1582 FlowGraphPrinter::ShouldPrint(flow_graph_->function())) {
1581 THR_Print("Range analysis: False unreachable (B%" Pd ")\n", 1583 THR_Print("Range analysis: False unreachable (B%" Pd ")\n",
1582 branch->false_successor()->block_id()); 1584 branch->false_successor()->block_id());
1583 } 1585 }
1584 branch->set_constant_target(branch->true_successor()); 1586 branch->set_constant_target(branch->true_successor());
1585 } 1587 }
1586 } 1588 }
1587 } 1589 }
1588 } 1590 }
1589 1591
1590 1592
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
3157 } 3159 }
3158 } while (CanonicalizeMaxBoundary(&max) || 3160 } while (CanonicalizeMaxBoundary(&max) ||
3159 CanonicalizeMinBoundary(&canonical_length)); 3161 CanonicalizeMinBoundary(&canonical_length));
3160 3162
3161 // Failed to prove that maximum is bounded with array length. 3163 // Failed to prove that maximum is bounded with array length.
3162 return false; 3164 return false;
3163 } 3165 }
3164 3166
3165 3167
3166 } // namespace dart 3168 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698