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

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

Issue 261823005: Optimize conditional branches that have same true/false targets. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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') | 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/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 // We have to perform range analysis after LICM because it 460 // We have to perform range analysis after LICM because it
461 // optimistically moves CheckSmi through phis into loop preheaders 461 // optimistically moves CheckSmi through phis into loop preheaders
462 // making some phis smi. 462 // making some phis smi.
463 optimizer.InferSmiRanges(); 463 optimizer.InferSmiRanges();
464 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 464 DEBUG_ASSERT(flow_graph->VerifyUseLists());
465 } 465 }
466 466
467 if (FLAG_constant_propagation) { 467 if (FLAG_constant_propagation) {
468 // Constant propagation can use information from range analysis to 468 // Constant propagation can use information from range analysis to
469 // find unreachable branch targets. 469 // find unreachable branch targets and eliminate branches that have
470 // the same true- and false-target.
470 ConstantPropagator::OptimizeBranches(flow_graph); 471 ConstantPropagator::OptimizeBranches(flow_graph);
471 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 472 DEBUG_ASSERT(flow_graph->VerifyUseLists());
472 } 473 }
473 474
474 // Recompute types after code movement was done to ensure correct 475 // Recompute types after code movement was done to ensure correct
475 // reaching types for hoisted values. 476 // reaching types for hoisted values.
476 FlowGraphTypePropagator::Propagate(flow_graph); 477 FlowGraphTypePropagator::Propagate(flow_graph);
477 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 478 DEBUG_ASSERT(flow_graph->VerifyUseLists());
478 479
479 // Optimize try-blocks. 480 // Optimize try-blocks.
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 const Object& result = 963 const Object& result =
963 Object::Handle(isolate->object_store()->sticky_error()); 964 Object::Handle(isolate->object_store()->sticky_error());
964 isolate->object_store()->clear_sticky_error(); 965 isolate->object_store()->clear_sticky_error();
965 return result.raw(); 966 return result.raw();
966 } 967 }
967 UNREACHABLE(); 968 UNREACHABLE();
968 return Object::null(); 969 return Object::null();
969 } 970 }
970 971
971 } // namespace dart 972 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698