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

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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 if (optimized) { 172 if (optimized) {
173 TimerScope timer(FLAG_compiler_stats, 173 TimerScope timer(FLAG_compiler_stats,
174 &CompilerStats::graphoptimizer_timer, 174 &CompilerStats::graphoptimizer_timer,
175 isolate); 175 isolate);
176 176
177 FlowGraphOptimizer optimizer(flow_graph); 177 FlowGraphOptimizer optimizer(flow_graph);
178 optimizer.ApplyICData(); 178 optimizer.ApplyICData();
179 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 179 DEBUG_ASSERT(flow_graph->VerifyUseLists());
180 180
181 // Optimize (a << b) & c patterns. Must occur before
182 // 'Selectrepresentations' which inserts conversion nodes.
183 // TODO(srdjan): Move de before inlinining until environmenr use list can
Vyacheslav Egorov (Google) 2013/02/21 14:45:50 "Moved", "environment" . I find it very fragile.
srdjan 2013/02/21 21:55:31 Fixed spelling. As discussed, added a flag (trunc
184 // be used to detect when shift-left is outside the scope of bit-and.
185 optimizer.TryOptimizeLeftShiftWithBitAndPattern();
186
181 // Inlining (mutates the flow graph) 187 // Inlining (mutates the flow graph)
182 if (FLAG_use_inlining) { 188 if (FLAG_use_inlining) {
183 TimerScope timer(FLAG_compiler_stats, 189 TimerScope timer(FLAG_compiler_stats,
184 &CompilerStats::graphinliner_timer); 190 &CompilerStats::graphinliner_timer);
185 FlowGraphInliner inliner(flow_graph); 191 FlowGraphInliner inliner(flow_graph);
186 inliner.Inline(); 192 inliner.Inline();
187 // Use lists are maintained and validated by the inliner. 193 // Use lists are maintained and validated by the inliner.
188 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 194 DEBUG_ASSERT(flow_graph->VerifyUseLists());
189 } 195 }
190 196
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 Object::Handle(isolate->object_store()->sticky_error()); 648 Object::Handle(isolate->object_store()->sticky_error());
643 isolate->object_store()->clear_sticky_error(); 649 isolate->object_store()->clear_sticky_error();
644 isolate->set_long_jump_base(base); 650 isolate->set_long_jump_base(base);
645 return result.raw(); 651 return result.raw();
646 } 652 }
647 UNREACHABLE(); 653 UNREACHABLE();
648 return Object::null(); 654 return Object::null();
649 } 655 }
650 656
651 } // namespace dart 657 } // 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