Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: runtime/vm/compiler.cc

Issue 2265873005: VM: Remove more duplicate code between AOT and JIT compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 caller_inline_id.Add(-1); 799 caller_inline_id.Add(-1);
800 CSTAT_TIMER_SCOPE(thread(), graphoptimizer_timer); 800 CSTAT_TIMER_SCOPE(thread(), graphoptimizer_timer);
801 801
802 JitOptimizer optimizer(flow_graph); 802 JitOptimizer optimizer(flow_graph);
803 803
804 optimizer.ApplyICData(); 804 optimizer.ApplyICData();
805 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 805 DEBUG_ASSERT(flow_graph->VerifyUseLists());
806 806
807 // Optimize (a << b) & c patterns, merge operations. 807 // Optimize (a << b) & c patterns, merge operations.
808 // Run early in order to have more opportunity to optimize left shifts. 808 // Run early in order to have more opportunity to optimize left shifts.
809 optimizer.TryOptimizePatterns(); 809 flow_graph->TryOptimizePatterns();
810 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 810 DEBUG_ASSERT(flow_graph->VerifyUseLists());
811 811
812 FlowGraphInliner::SetInliningId(flow_graph, 0); 812 FlowGraphInliner::SetInliningId(flow_graph, 0);
813 813
814 // Inlining (mutates the flow graph) 814 // Inlining (mutates the flow graph)
815 if (FLAG_use_inlining) { 815 if (FLAG_use_inlining) {
816 NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), 816 NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
817 compiler_timeline, 817 compiler_timeline,
818 "Inlining")); 818 "Inlining"));
819 CSTAT_TIMER_SCOPE(thread(), graphinliner_timer); 819 CSTAT_TIMER_SCOPE(thread(), graphinliner_timer);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 LICM licm(flow_graph); 946 LICM licm(flow_graph);
947 licm.Optimize(); 947 licm.Optimize();
948 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 948 DEBUG_ASSERT(flow_graph->VerifyUseLists());
949 } 949 }
950 flow_graph->RemoveRedefinitions(); 950 flow_graph->RemoveRedefinitions();
951 } 951 }
952 952
953 // Optimize (a << b) & c patterns, merge operations. 953 // Optimize (a << b) & c patterns, merge operations.
954 // Run after CSE in order to have more opportunity to merge 954 // Run after CSE in order to have more opportunity to merge
955 // instructions that have same inputs. 955 // instructions that have same inputs.
956 optimizer.TryOptimizePatterns(); 956 flow_graph->TryOptimizePatterns();
957 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 957 DEBUG_ASSERT(flow_graph->VerifyUseLists());
958 958
959 { 959 {
960 NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), 960 NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(),
961 compiler_timeline, 961 compiler_timeline,
962 "DeadStoreElimination")); 962 "DeadStoreElimination"));
963 DeadStoreElimination::Optimize(flow_graph); 963 DeadStoreElimination::Optimize(flow_graph);
964 } 964 }
965 965
966 if (FLAG_range_analysis) { 966 if (FLAG_range_analysis) {
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 2179
2180 2180
2181 bool BackgroundCompiler::IsDisabled() { 2181 bool BackgroundCompiler::IsDisabled() {
2182 UNREACHABLE(); 2182 UNREACHABLE();
2183 return true; 2183 return true;
2184 } 2184 }
2185 2185
2186 #endif // DART_PRECOMPILED_RUNTIME 2186 #endif // DART_PRECOMPILED_RUNTIME
2187 2187
2188 } // namespace dart 2188 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698