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

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

Issue 23549020: Optimize conditional branches that have same true/false targets. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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.h » ('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/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 // optimistically moves CheckSmi through phis into loop preheaders 449 // optimistically moves CheckSmi through phis into loop preheaders
450 // making some phis smi. 450 // making some phis smi.
451 optimizer.InferSmiRanges(); 451 optimizer.InferSmiRanges();
452 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 452 DEBUG_ASSERT(flow_graph->VerifyUseLists());
453 } 453 }
454 454
455 if (FLAG_constant_propagation) { 455 if (FLAG_constant_propagation) {
456 // Constant propagation can use information from range analysis to 456 // Constant propagation can use information from range analysis to
457 // find unreachable branch targets. 457 // find unreachable branch targets.
458 ConstantPropagator::OptimizeBranches(flow_graph); 458 ConstantPropagator::OptimizeBranches(flow_graph);
459 // Eliminate branches that have the same true- and false-target.
460 ConstantPropagator::RemoveRedundantBranches(flow_graph);
Kevin Millikin (Google) 2013/09/27 11:03:43 Since Optimize and RemoveRedundant go together, I'
Florian Schneider 2013/09/30 12:19:23 Done.
459 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 461 DEBUG_ASSERT(flow_graph->VerifyUseLists());
460 } 462 }
461 463
462 if (FLAG_propagate_types) { 464 if (FLAG_propagate_types) {
463 // Recompute types after code movement was done to ensure correct 465 // Recompute types after code movement was done to ensure correct
464 // reaching types for hoisted values. 466 // reaching types for hoisted values.
465 FlowGraphTypePropagator propagator(flow_graph); 467 FlowGraphTypePropagator propagator(flow_graph);
466 propagator.Propagate(); 468 propagator.Propagate();
467 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 469 DEBUG_ASSERT(flow_graph->VerifyUseLists());
468 } 470 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 Object::Handle(isolate->object_store()->sticky_error()); 926 Object::Handle(isolate->object_store()->sticky_error());
925 isolate->object_store()->clear_sticky_error(); 927 isolate->object_store()->clear_sticky_error();
926 isolate->set_long_jump_base(base); 928 isolate->set_long_jump_base(base);
927 return result.raw(); 929 return result.raw();
928 } 930 }
929 UNREACHABLE(); 931 UNREACHABLE();
930 return Object::null(); 932 return Object::null();
931 } 933 }
932 934
933 } // namespace dart 935 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | runtime/vm/flow_graph_optimizer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698