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/code_generator.h" | 10 #include "vm/code_generator.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 propagator.Propagate(); | 238 propagator.Propagate(); |
239 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 239 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
240 } | 240 } |
241 | 241 |
242 // Unbox doubles. Performed after constant propagation to minimize | 242 // Unbox doubles. Performed after constant propagation to minimize |
243 // interference from phis merging double values and tagged | 243 // interference from phis merging double values and tagged |
244 // values comming from dead paths. | 244 // values comming from dead paths. |
245 optimizer.SelectRepresentations(); | 245 optimizer.SelectRepresentations(); |
246 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 246 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
247 | 247 |
| 248 if (FLAG_common_subexpression_elimination || |
| 249 FLAG_loop_invariant_code_motion) { |
| 250 flow_graph->ComputeBlockEffects(); |
| 251 } |
| 252 |
248 if (FLAG_common_subexpression_elimination) { | 253 if (FLAG_common_subexpression_elimination) { |
249 if (DominatorBasedCSE::Optimize(flow_graph)) { | 254 if (DominatorBasedCSE::Optimize(flow_graph)) { |
250 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 255 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
251 // Do another round of CSE to take secondary effects into account: | 256 // Do another round of CSE to take secondary effects into account: |
252 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) | 257 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) |
253 // TODO(fschneider): Change to a one-pass optimization pass. | 258 // TODO(fschneider): Change to a one-pass optimization pass. |
254 DominatorBasedCSE::Optimize(flow_graph); | 259 DominatorBasedCSE::Optimize(flow_graph); |
255 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 260 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
256 } | 261 } |
257 } | 262 } |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 Object::Handle(isolate->object_store()->sticky_error()); | 699 Object::Handle(isolate->object_store()->sticky_error()); |
695 isolate->object_store()->clear_sticky_error(); | 700 isolate->object_store()->clear_sticky_error(); |
696 isolate->set_long_jump_base(base); | 701 isolate->set_long_jump_base(base); |
697 return result.raw(); | 702 return result.raw(); |
698 } | 703 } |
699 UNREACHABLE(); | 704 UNREACHABLE(); |
700 return Object::null(); | 705 return Object::null(); |
701 } | 706 } |
702 | 707 |
703 } // namespace dart | 708 } // namespace dart |
OLD | NEW |