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

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

Issue 12038013: Reland r17365. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: replace enter with EnterFrame Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/disassembler_x64.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
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/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 // Use propagated class-ids to optimize further. 205 // Use propagated class-ids to optimize further.
206 optimizer.ApplyClassIds(); 206 optimizer.ApplyClassIds();
207 207
208 // Recompute use lists after applying class ids. 208 // Recompute use lists after applying class ids.
209 flow_graph->ComputeUseLists(); 209 flow_graph->ComputeUseLists();
210 210
211 // Do optimizations that depend on the propagated type information. 211 // Do optimizations that depend on the propagated type information.
212 optimizer.Canonicalize(); 212 optimizer.Canonicalize();
213 213
214 // Unbox doubles.
215 flow_graph->ComputeUseLists(); 214 flow_graph->ComputeUseLists();
216 optimizer.SelectRepresentations();
217 215
218 if (FLAG_constant_propagation ||
219 FLAG_common_subexpression_elimination) {
220 flow_graph->ComputeUseLists();
221 }
222 if (FLAG_constant_propagation) { 216 if (FLAG_constant_propagation) {
223 ConstantPropagator::Optimize(flow_graph); 217 ConstantPropagator::Optimize(flow_graph);
224 // A canonicalization pass to remove e.g. smi checks on smi constants. 218 // A canonicalization pass to remove e.g. smi checks on smi constants.
225 optimizer.Canonicalize(); 219 optimizer.Canonicalize();
226 } 220 }
221
222 // Unbox doubles. Performed after constant propagation to minimize
223 // interference from phis merging double values and tagged
224 // values comming from dead paths.
225 flow_graph->ComputeUseLists();
226 optimizer.SelectRepresentations();
227 flow_graph->ComputeUseLists();
228
227 if (FLAG_common_subexpression_elimination) { 229 if (FLAG_common_subexpression_elimination) {
228 if (DominatorBasedCSE::Optimize(flow_graph)) { 230 if (DominatorBasedCSE::Optimize(flow_graph)) {
229 // Do another round of CSE to take secondary effects into account: 231 // Do another round of CSE to take secondary effects into account:
230 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) 232 // e.g. when eliminating dependent loads (a.x[0] + a.x[0])
231 // TODO(fschneider): Change to a one-pass optimization pass. 233 // TODO(fschneider): Change to a one-pass optimization pass.
232 DominatorBasedCSE::Optimize(flow_graph); 234 DominatorBasedCSE::Optimize(flow_graph);
233 } 235 }
234 } 236 }
235 if (FLAG_loop_invariant_code_motion && 237 if (FLAG_loop_invariant_code_motion &&
236 (parsed_function.function().deoptimization_counter() < 238 (parsed_function.function().deoptimization_counter() <
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 Object::Handle(isolate->object_store()->sticky_error()); 642 Object::Handle(isolate->object_store()->sticky_error());
641 isolate->object_store()->clear_sticky_error(); 643 isolate->object_store()->clear_sticky_error();
642 isolate->set_long_jump_base(base); 644 isolate->set_long_jump_base(base);
643 return result.raw(); 645 return result.raw();
644 } 646 }
645 UNREACHABLE(); 647 UNREACHABLE();
646 return Object::null(); 648 return Object::null();
647 } 649 }
648 650
649 } // namespace dart 651 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/disassembler_x64.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698