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

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

Issue 12540002: Implement a branch optimization pass. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 9 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.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/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 // Use propagated class-ids to optimize further. 203 // Use propagated class-ids to optimize further.
204 optimizer.ApplyClassIds(); 204 optimizer.ApplyClassIds();
205 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 205 DEBUG_ASSERT(flow_graph->VerifyUseLists());
206 206
207 // Do optimizations that depend on the propagated type information. 207 // Do optimizations that depend on the propagated type information.
208 optimizer.Canonicalize(); 208 optimizer.Canonicalize();
209 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 209 DEBUG_ASSERT(flow_graph->VerifyUseLists());
210 210
211 BranchSimplifier::Simplify(flow_graph);
212 DEBUG_ASSERT(flow_graph->VerifyUseLists());
213
211 if (FLAG_constant_propagation) { 214 if (FLAG_constant_propagation) {
212 ConstantPropagator::Optimize(flow_graph); 215 ConstantPropagator::Optimize(flow_graph);
213 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 216 DEBUG_ASSERT(flow_graph->VerifyUseLists());
214 // A canonicalization pass to remove e.g. smi checks on smi constants. 217 // A canonicalization pass to remove e.g. smi checks on smi constants.
215 optimizer.Canonicalize(); 218 optimizer.Canonicalize();
216 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 219 DEBUG_ASSERT(flow_graph->VerifyUseLists());
217 } 220 }
218 221
219 // Propagate types and eliminate even more type tests. 222 // Propagate types and eliminate even more type tests.
220 if (FLAG_propagate_types) { 223 if (FLAG_propagate_types) {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 Object::Handle(isolate->object_store()->sticky_error()); 661 Object::Handle(isolate->object_store()->sticky_error());
659 isolate->object_store()->clear_sticky_error(); 662 isolate->object_store()->clear_sticky_error();
660 isolate->set_long_jump_base(base); 663 isolate->set_long_jump_base(base);
661 return result.raw(); 664 return result.raw();
662 } 665 }
663 UNREACHABLE(); 666 UNREACHABLE();
664 return Object::null(); 667 return Object::null();
665 } 668 }
666 669
667 } // namespace dart 670 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698