| OLD | NEW |
| 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 Loading... |
| 472 TryCatchAnalyzer::Optimize(flow_graph); | 472 TryCatchAnalyzer::Optimize(flow_graph); |
| 473 | 473 |
| 474 // Detach environments from the instructions that can't deoptimize. | 474 // Detach environments from the instructions that can't deoptimize. |
| 475 // Do it before we attempt to perform allocation sinking to minimize | 475 // Do it before we attempt to perform allocation sinking to minimize |
| 476 // amount of materializations it has to perform. | 476 // amount of materializations it has to perform. |
| 477 optimizer.EliminateEnvironments(); | 477 optimizer.EliminateEnvironments(); |
| 478 | 478 |
| 479 DeadCodeElimination::EliminateDeadPhis(flow_graph); | 479 DeadCodeElimination::EliminateDeadPhis(flow_graph); |
| 480 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 480 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 481 | 481 |
| 482 if (optimizer.Canonicalize()) { |
| 483 optimizer.Canonicalize(); |
| 484 } |
| 485 |
| 482 // Attempt to sink allocations of temporary non-escaping objects to | 486 // Attempt to sink allocations of temporary non-escaping objects to |
| 483 // the deoptimization path. | 487 // the deoptimization path. |
| 484 AllocationSinking* sinking = NULL; | 488 AllocationSinking* sinking = NULL; |
| 485 if (FLAG_allocation_sinking && | 489 if (FLAG_allocation_sinking && |
| 486 (flow_graph->graph_entry()->SuccessorCount() == 1)) { | 490 (flow_graph->graph_entry()->SuccessorCount() == 1)) { |
| 487 // TODO(fschneider): Support allocation sinking with try-catch. | 491 // TODO(fschneider): Support allocation sinking with try-catch. |
| 488 sinking = new AllocationSinking(flow_graph); | 492 sinking = new AllocationSinking(flow_graph); |
| 489 sinking->Optimize(); | 493 sinking->Optimize(); |
| 490 } | 494 } |
| 491 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 495 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 const Object& result = | 973 const Object& result = |
| 970 Object::Handle(isolate->object_store()->sticky_error()); | 974 Object::Handle(isolate->object_store()->sticky_error()); |
| 971 isolate->object_store()->clear_sticky_error(); | 975 isolate->object_store()->clear_sticky_error(); |
| 972 return result.raw(); | 976 return result.raw(); |
| 973 } | 977 } |
| 974 UNREACHABLE(); | 978 UNREACHABLE(); |
| 975 return Object::null(); | 979 return Object::null(); |
| 976 } | 980 } |
| 977 | 981 |
| 978 } // namespace dart | 982 } // namespace dart |
| OLD | NEW |