| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // Do another round of CSE to take secondary effects into account: | 229 // Do another round of CSE to take secondary effects into account: |
| 230 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) | 230 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) |
| 231 // TODO(fschneider): Change to a one-pass optimization pass. | 231 // TODO(fschneider): Change to a one-pass optimization pass. |
| 232 DominatorBasedCSE::Optimize(flow_graph); | 232 DominatorBasedCSE::Optimize(flow_graph); |
| 233 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 233 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 if (FLAG_loop_invariant_code_motion && | 236 if (FLAG_loop_invariant_code_motion && |
| 237 (parsed_function.function().deoptimization_counter() < | 237 (parsed_function.function().deoptimization_counter() < |
| 238 (FLAG_deoptimization_counter_threshold - 1))) { | 238 (FLAG_deoptimization_counter_threshold - 1))) { |
| 239 LICM::Optimize(flow_graph); | 239 LICM licm(flow_graph); |
| 240 licm.Optimize(); |
| 240 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 241 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 241 } | 242 } |
| 242 | 243 |
| 243 if (FLAG_range_analysis) { | 244 if (FLAG_range_analysis) { |
| 244 // We have to perform range analysis after LICM because it | 245 // We have to perform range analysis after LICM because it |
| 245 // optimistically moves CheckSmi through phis into loop preheaders | 246 // optimistically moves CheckSmi through phis into loop preheaders |
| 246 // making some phis smi. | 247 // making some phis smi. |
| 247 optimizer.InferSmiRanges(); | 248 optimizer.InferSmiRanges(); |
| 248 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 249 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 249 } | 250 } |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 Object::Handle(isolate->object_store()->sticky_error()); | 649 Object::Handle(isolate->object_store()->sticky_error()); |
| 649 isolate->object_store()->clear_sticky_error(); | 650 isolate->object_store()->clear_sticky_error(); |
| 650 isolate->set_long_jump_base(base); | 651 isolate->set_long_jump_base(base); |
| 651 return result.raw(); | 652 return result.raw(); |
| 652 } | 653 } |
| 653 UNREACHABLE(); | 654 UNREACHABLE(); |
| 654 return Object::null(); | 655 return Object::null(); |
| 655 } | 656 } |
| 656 | 657 |
| 657 } // namespace dart | 658 } // namespace dart |
| OLD | NEW |