| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
| (...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2419 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 2419 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 2420 | 2420 |
| 2421 FlowGraphTypePropagator::Propagate(flow_graph); | 2421 FlowGraphTypePropagator::Propagate(flow_graph); |
| 2422 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 2422 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 2423 | 2423 |
| 2424 optimizer.ApplyICData(); | 2424 optimizer.ApplyICData(); |
| 2425 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 2425 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 2426 | 2426 |
| 2427 // Optimize (a << b) & c patterns, merge operations. | 2427 // Optimize (a << b) & c patterns, merge operations. |
| 2428 // Run early in order to have more opportunity to optimize left shifts. | 2428 // Run early in order to have more opportunity to optimize left shifts. |
| 2429 optimizer.TryOptimizePatterns(); | 2429 flow_graph->TryOptimizePatterns(); |
| 2430 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 2430 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 2431 | 2431 |
| 2432 FlowGraphInliner::SetInliningId(flow_graph, 0); | 2432 FlowGraphInliner::SetInliningId(flow_graph, 0); |
| 2433 | 2433 |
| 2434 // Inlining (mutates the flow graph) | 2434 // Inlining (mutates the flow graph) |
| 2435 if (FLAG_use_inlining) { | 2435 if (FLAG_use_inlining) { |
| 2436 #ifndef PRODUCT | 2436 #ifndef PRODUCT |
| 2437 TimelineDurationScope tds2(thread(), | 2437 TimelineDurationScope tds2(thread(), |
| 2438 compiler_timeline, | 2438 compiler_timeline, |
| 2439 "Inlining"); | 2439 "Inlining"); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 LICM licm(flow_graph); | 2579 LICM licm(flow_graph); |
| 2580 licm.Optimize(); | 2580 licm.Optimize(); |
| 2581 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 2581 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 2582 } | 2582 } |
| 2583 flow_graph->RemoveRedefinitions(); | 2583 flow_graph->RemoveRedefinitions(); |
| 2584 } | 2584 } |
| 2585 | 2585 |
| 2586 // Optimize (a << b) & c patterns, merge operations. | 2586 // Optimize (a << b) & c patterns, merge operations. |
| 2587 // Run after CSE in order to have more opportunity to merge | 2587 // Run after CSE in order to have more opportunity to merge |
| 2588 // instructions that have same inputs. | 2588 // instructions that have same inputs. |
| 2589 optimizer.TryOptimizePatterns(); | 2589 flow_graph->TryOptimizePatterns(); |
| 2590 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 2590 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 2591 | 2591 |
| 2592 { | 2592 { |
| 2593 #ifndef PRODUCT | 2593 #ifndef PRODUCT |
| 2594 TimelineDurationScope tds2(thread(), | 2594 TimelineDurationScope tds2(thread(), |
| 2595 compiler_timeline, | 2595 compiler_timeline, |
| 2596 "DeadStoreElimination"); | 2596 "DeadStoreElimination"); |
| 2597 #endif // !PRODUCT | 2597 #endif // !PRODUCT |
| 2598 DeadStoreElimination::Optimize(flow_graph); | 2598 DeadStoreElimination::Optimize(flow_graph); |
| 2599 } | 2599 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2930 CompilationPipeline::New(thread->zone(), function); | 2930 CompilationPipeline::New(thread->zone(), function); |
| 2931 | 2931 |
| 2932 ASSERT(FLAG_precompiled_mode); | 2932 ASSERT(FLAG_precompiled_mode); |
| 2933 const bool optimized = function.IsOptimizable(); // False for natives. | 2933 const bool optimized = function.IsOptimizable(); // False for natives. |
| 2934 return PrecompileFunctionHelper(pipeline, function, optimized); | 2934 return PrecompileFunctionHelper(pipeline, function, optimized); |
| 2935 } | 2935 } |
| 2936 | 2936 |
| 2937 #endif // DART_PRECOMPILER | 2937 #endif // DART_PRECOMPILER |
| 2938 | 2938 |
| 2939 } // namespace dart | 2939 } // namespace dart |
| OLD | NEW |