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

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

Issue 328743003: Update use lists after eliminating redundant phis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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.cc » ('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/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 472
473 // Optimize try-blocks. 473 // Optimize try-blocks.
474 TryCatchAnalyzer::Optimize(flow_graph); 474 TryCatchAnalyzer::Optimize(flow_graph);
475 475
476 // Detach environments from the instructions that can't deoptimize. 476 // Detach environments from the instructions that can't deoptimize.
477 // Do it before we attempt to perform allocation sinking to minimize 477 // Do it before we attempt to perform allocation sinking to minimize
478 // amount of materializations it has to perform. 478 // amount of materializations it has to perform.
479 optimizer.EliminateEnvironments(); 479 optimizer.EliminateEnvironments();
480 480
481 DeadCodeElimination::EliminateDeadPhis(flow_graph); 481 DeadCodeElimination::EliminateDeadPhis(flow_graph);
482 DEBUG_ASSERT(flow_graph->VerifyUseLists());
482 483
483 // Attempt to sink allocations of temporary non-escaping objects to 484 // Attempt to sink allocations of temporary non-escaping objects to
484 // the deoptimization path. 485 // the deoptimization path.
485 AllocationSinking* sinking = NULL; 486 AllocationSinking* sinking = NULL;
486 if (FLAG_allocation_sinking && 487 if (FLAG_allocation_sinking &&
487 (flow_graph->graph_entry()->SuccessorCount() == 1)) { 488 (flow_graph->graph_entry()->SuccessorCount() == 1)) {
488 // TODO(fschneider): Support allocation sinking with try-catch. 489 // TODO(fschneider): Support allocation sinking with try-catch.
489 sinking = new AllocationSinking(flow_graph); 490 sinking = new AllocationSinking(flow_graph);
490 sinking->Optimize(); 491 sinking->Optimize();
491 } 492 }
493 DEBUG_ASSERT(flow_graph->VerifyUseLists());
492 494
493 // Ensure that all phis inserted by optimization passes have consistent 495 // Ensure that all phis inserted by optimization passes have consistent
494 // representations. 496 // representations.
495 optimizer.SelectRepresentations(); 497 optimizer.SelectRepresentations();
496 498
497 if (optimizer.Canonicalize()) { 499 if (optimizer.Canonicalize()) {
498 // To fully remove redundant boxing (e.g. BoxDouble used only in 500 // To fully remove redundant boxing (e.g. BoxDouble used only in
499 // environments and UnboxDouble instructions) instruction we 501 // environments and UnboxDouble instructions) instruction we
500 // first need to replace all their uses and then fold them away. 502 // first need to replace all their uses and then fold them away.
501 // For now we just repeat Canonicalize twice to do that. 503 // For now we just repeat Canonicalize twice to do that.
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 const Object& result = 977 const Object& result =
976 Object::Handle(isolate->object_store()->sticky_error()); 978 Object::Handle(isolate->object_store()->sticky_error());
977 isolate->object_store()->clear_sticky_error(); 979 isolate->object_store()->clear_sticky_error();
978 return result.raw(); 980 return result.raw();
979 } 981 }
980 UNREACHABLE(); 982 UNREACHABLE();
981 return Object::null(); 983 return Object::null();
982 } 984 }
983 985
984 } // namespace dart 986 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698