| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 DEFINE_FLAG(bool, trace_optimization, false, "Print optimization details."); | 31 DEFINE_FLAG(bool, trace_optimization, false, "Print optimization details."); |
| 32 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress"); | 32 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress"); |
| 33 DEFINE_FLAG(bool, truncating_left_shift, true, | 33 DEFINE_FLAG(bool, truncating_left_shift, true, |
| 34 "Optimize left shift to truncate if possible"); | 34 "Optimize left shift to truncate if possible"); |
| 35 DEFINE_FLAG(bool, use_cha, true, "Use class hierarchy analysis."); | 35 DEFINE_FLAG(bool, use_cha, true, "Use class hierarchy analysis."); |
| 36 DECLARE_FLAG(bool, eliminate_type_checks); | 36 DECLARE_FLAG(bool, eliminate_type_checks); |
| 37 DECLARE_FLAG(bool, enable_type_checks); | 37 DECLARE_FLAG(bool, enable_type_checks); |
| 38 DECLARE_FLAG(bool, trace_type_check_elimination); | 38 DECLARE_FLAG(bool, trace_type_check_elimination); |
| 39 | 39 |
| 40 | 40 |
| 41 | |
| 42 // Optimize instance calls using ICData. | 41 // Optimize instance calls using ICData. |
| 43 void FlowGraphOptimizer::ApplyICData() { | 42 void FlowGraphOptimizer::ApplyICData() { |
| 44 VisitBlocks(); | 43 VisitBlocks(); |
| 45 } | 44 } |
| 46 | 45 |
| 47 | 46 |
| 48 // Optimize instance calls using cid. | 47 // Optimize instance calls using cid. |
| 49 // Attempts to convert an instance call (IC call) using propagated class-ids, | 48 // Attempts to convert an instance call (IC call) using propagated class-ids, |
| 50 // e.g., receiver class id, guarded-cid. | 49 // e.g., receiver class id, guarded-cid. |
| 51 void FlowGraphOptimizer::ApplyClassIds() { | 50 void FlowGraphOptimizer::ApplyClassIds() { |
| (...skipping 6371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6423 | 6422 |
| 6424 // Insert materializations at environment uses. | 6423 // Insert materializations at environment uses. |
| 6425 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 6424 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
| 6426 for (intptr_t i = 0; i < exits.length(); i++) { | 6425 for (intptr_t i = 0; i < exits.length(); i++) { |
| 6427 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 6426 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
| 6428 } | 6427 } |
| 6429 } | 6428 } |
| 6430 | 6429 |
| 6431 | 6430 |
| 6432 } // namespace dart | 6431 } // namespace dart |
| OLD | NEW |