| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 // Propagate types and eliminate more type tests. | 364 // Propagate types and eliminate more type tests. |
| 365 FlowGraphTypePropagator::Propagate(flow_graph); | 365 FlowGraphTypePropagator::Propagate(flow_graph); |
| 366 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 366 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 367 | 367 |
| 368 // Use propagated class-ids to optimize further. | 368 // Use propagated class-ids to optimize further. |
| 369 optimizer.ApplyClassIds(); | 369 optimizer.ApplyClassIds(); |
| 370 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 370 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 371 | 371 |
| 372 // Do optimizations that depend on the propagated type information. | 372 // Do optimizations that depend on the propagated type information. |
| 373 optimizer.Canonicalize(); | 373 if (optimizer.Canonicalize()) { |
| 374 // Invoke Canonicalize twice in order to fully canonicalize patterns |
| 375 // like "if (a & const == 0) { }". |
| 376 optimizer.Canonicalize(); |
| 377 } |
| 374 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 378 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 375 | 379 |
| 376 BranchSimplifier::Simplify(flow_graph); | 380 BranchSimplifier::Simplify(flow_graph); |
| 377 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 381 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 378 | 382 |
| 379 IfConverter::Simplify(flow_graph); | 383 IfConverter::Simplify(flow_graph); |
| 380 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 384 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 381 | 385 |
| 382 if (FLAG_constant_propagation) { | 386 if (FLAG_constant_propagation) { |
| 383 ConstantPropagator::Optimize(flow_graph); | 387 ConstantPropagator::Optimize(flow_graph); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 Object::Handle(isolate->object_store()->sticky_error()); | 932 Object::Handle(isolate->object_store()->sticky_error()); |
| 929 isolate->object_store()->clear_sticky_error(); | 933 isolate->object_store()->clear_sticky_error(); |
| 930 isolate->set_long_jump_base(base); | 934 isolate->set_long_jump_base(base); |
| 931 return result.raw(); | 935 return result.raw(); |
| 932 } | 936 } |
| 933 UNREACHABLE(); | 937 UNREACHABLE(); |
| 934 return Object::null(); | 938 return Object::null(); |
| 935 } | 939 } |
| 936 | 940 |
| 937 } // namespace dart | 941 } // namespace dart |
| OLD | NEW |