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

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

Issue 790143002: Fix dead phis elimination. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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.cc » ('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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 // the deoptimization path. 632 // the deoptimization path.
633 AllocationSinking* sinking = NULL; 633 AllocationSinking* sinking = NULL;
634 if (FLAG_allocation_sinking && 634 if (FLAG_allocation_sinking &&
635 (flow_graph->graph_entry()->SuccessorCount() == 1)) { 635 (flow_graph->graph_entry()->SuccessorCount() == 1)) {
636 // TODO(fschneider): Support allocation sinking with try-catch. 636 // TODO(fschneider): Support allocation sinking with try-catch.
637 sinking = new AllocationSinking(flow_graph); 637 sinking = new AllocationSinking(flow_graph);
638 sinking->Optimize(); 638 sinking->Optimize();
639 } 639 }
640 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 640 DEBUG_ASSERT(flow_graph->VerifyUseLists());
641 641
642 DeadCodeElimination::EliminateDeadPhis(flow_graph);
643 DEBUG_ASSERT(flow_graph->VerifyUseLists());
644
642 // Ensure that all phis inserted by optimization passes have consistent 645 // Ensure that all phis inserted by optimization passes have consistent
643 // representations. 646 // representations.
644 optimizer.SelectRepresentations(); 647 optimizer.SelectRepresentations();
645 648
646 if (optimizer.Canonicalize()) { 649 if (optimizer.Canonicalize()) {
647 // To fully remove redundant boxing (e.g. BoxDouble used only in 650 // To fully remove redundant boxing (e.g. BoxDouble used only in
648 // environments and UnboxDouble instructions) instruction we 651 // environments and UnboxDouble instructions) instruction we
649 // first need to replace all their uses and then fold them away. 652 // first need to replace all their uses and then fold them away.
650 // For now we just repeat Canonicalize twice to do that. 653 // For now we just repeat Canonicalize twice to do that.
651 // TODO(vegorov): implement a separate representation folding pass. 654 // TODO(vegorov): implement a separate representation folding pass.
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 const Object& result = 1181 const Object& result =
1179 PassiveObject::Handle(isolate->object_store()->sticky_error()); 1182 PassiveObject::Handle(isolate->object_store()->sticky_error());
1180 isolate->object_store()->clear_sticky_error(); 1183 isolate->object_store()->clear_sticky_error();
1181 return result.raw(); 1184 return result.raw();
1182 } 1185 }
1183 UNREACHABLE(); 1186 UNREACHABLE();
1184 return Object::null(); 1187 return Object::null();
1185 } 1188 }
1186 1189
1187 } // namespace dart 1190 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698