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