| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 // Unbox doubles. Performed after constant propagation to minimize | 955 // Unbox doubles. Performed after constant propagation to minimize |
| 956 // interference from phis merging double values and tagged | 956 // interference from phis merging double values and tagged |
| 957 // values coming from dead paths. | 957 // values coming from dead paths. |
| 958 flow_graph->SelectRepresentations(); | 958 flow_graph->SelectRepresentations(); |
| 959 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 959 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 960 } | 960 } |
| 961 | 961 |
| 962 { | 962 { |
| 963 NOT_IN_PRODUCT(TimelineDurationScope tds2( | 963 NOT_IN_PRODUCT(TimelineDurationScope tds2( |
| 964 thread(), compiler_timeline, "CommonSubexpressionElinination")); | 964 thread(), compiler_timeline, "CommonSubexpressionElinination")); |
| 965 if (FLAG_common_subexpression_elimination || | |
| 966 FLAG_loop_invariant_code_motion) { | |
| 967 flow_graph->ComputeBlockEffects(); | |
| 968 } | |
| 969 | 965 |
| 970 if (FLAG_common_subexpression_elimination) { | 966 if (FLAG_common_subexpression_elimination) { |
| 971 if (DominatorBasedCSE::Optimize(flow_graph)) { | 967 if (DominatorBasedCSE::Optimize(flow_graph)) { |
| 972 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 968 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 973 flow_graph->Canonicalize(); | 969 flow_graph->Canonicalize(); |
| 974 // Do another round of CSE to take secondary effects into account: | 970 // Do another round of CSE to take secondary effects into account: |
| 975 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) | 971 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) |
| 976 // TODO(fschneider): Change to a one-pass optimization pass. | 972 // TODO(fschneider): Change to a one-pass optimization pass. |
| 977 if (DominatorBasedCSE::Optimize(flow_graph)) { | 973 if (DominatorBasedCSE::Optimize(flow_graph)) { |
| 978 flow_graph->Canonicalize(); | 974 flow_graph->Canonicalize(); |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2282 } | 2278 } |
| 2283 | 2279 |
| 2284 bool BackgroundCompiler::IsDisabled() { | 2280 bool BackgroundCompiler::IsDisabled() { |
| 2285 UNREACHABLE(); | 2281 UNREACHABLE(); |
| 2286 return true; | 2282 return true; |
| 2287 } | 2283 } |
| 2288 | 2284 |
| 2289 #endif // DART_PRECOMPILED_RUNTIME | 2285 #endif // DART_PRECOMPILED_RUNTIME |
| 2290 | 2286 |
| 2291 } // namespace dart | 2287 } // namespace dart |
| OLD | NEW |