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

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

Issue 12218181: Recognize pattern (a << b) & c with c being a positive Smi and allow left shift to truncate the res… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/flow_graph_optimizer.h » ('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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 // Do optimizations that depend on the propagated type information. 214 // Do optimizations that depend on the propagated type information.
215 optimizer.Canonicalize(); 215 optimizer.Canonicalize();
216 216
217 if (FLAG_constant_propagation) { 217 if (FLAG_constant_propagation) {
218 ConstantPropagator::Optimize(flow_graph); 218 ConstantPropagator::Optimize(flow_graph);
219 // A canonicalization pass to remove e.g. smi checks on smi constants. 219 // A canonicalization pass to remove e.g. smi checks on smi constants.
220 optimizer.Canonicalize(); 220 optimizer.Canonicalize();
221 } 221 }
222 222
223 // Optimize (a << b) & c patterns. Must occur before
224 // 'Selectrepresentations' which inserts conversion nodes.
225 optimizer.TryOptimizeLeftShiftWithBitAndPattern();
226
223 // Unbox doubles. Performed after constant propagation to minimize 227 // Unbox doubles. Performed after constant propagation to minimize
224 // interference from phis merging double values and tagged 228 // interference from phis merging double values and tagged
225 // values comming from dead paths. 229 // values comming from dead paths.
226 optimizer.SelectRepresentations(); 230 optimizer.SelectRepresentations();
227 231
228 if (FLAG_common_subexpression_elimination) { 232 if (FLAG_common_subexpression_elimination) {
229 if (DominatorBasedCSE::Optimize(flow_graph)) { 233 if (DominatorBasedCSE::Optimize(flow_graph)) {
230 // Do another round of CSE to take secondary effects into account: 234 // Do another round of CSE to take secondary effects into account:
231 // e.g. when eliminating dependent loads (a.x[0] + a.x[0]) 235 // e.g. when eliminating dependent loads (a.x[0] + a.x[0])
232 // TODO(fschneider): Change to a one-pass optimization pass. 236 // TODO(fschneider): Change to a one-pass optimization pass.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 Object::Handle(isolate->object_store()->sticky_error()); 649 Object::Handle(isolate->object_store()->sticky_error());
646 isolate->object_store()->clear_sticky_error(); 650 isolate->object_store()->clear_sticky_error();
647 isolate->set_long_jump_base(base); 651 isolate->set_long_jump_base(base);
648 return result.raw(); 652 return result.raw();
649 } 653 }
650 UNREACHABLE(); 654 UNREACHABLE();
651 return Object::null(); 655 return Object::null();
652 } 656 }
653 657
654 } // namespace dart 658 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698