| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 } | 530 } |
| 531 | 531 |
| 532 // Attempt to sink allocations of temporary non-escaping objects to | 532 // Attempt to sink allocations of temporary non-escaping objects to |
| 533 // the deoptimization path. | 533 // the deoptimization path. |
| 534 AllocationSinking* sinking = NULL; | 534 AllocationSinking* sinking = NULL; |
| 535 if (FLAG_allocation_sinking && | 535 if (FLAG_allocation_sinking && |
| 536 (flow_graph->graph_entry()->SuccessorCount() == 1)) { | 536 (flow_graph->graph_entry()->SuccessorCount() == 1)) { |
| 537 // TODO(fschneider): Support allocation sinking with try-catch. | 537 // TODO(fschneider): Support allocation sinking with try-catch. |
| 538 sinking = new AllocationSinking(flow_graph); | 538 sinking = new AllocationSinking(flow_graph); |
| 539 sinking->Optimize(); | 539 sinking->Optimize(); |
| 540 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 540 } | 541 } |
| 542 |
| 543 // Recompute types after load elimination to ensure correct |
| 544 // types for created phi-instructions. |
| 545 FlowGraphTypePropagator::Propagate(flow_graph); |
| 541 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 546 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 542 | 547 |
| 543 // Ensure that all phis inserted by optimization passes have consistent | 548 // Ensure that all phis inserted by optimization passes have consistent |
| 544 // representations. | 549 // representations. |
| 545 optimizer.SelectRepresentations(); | 550 optimizer.SelectRepresentations(); |
| 546 | 551 |
| 547 if (optimizer.Canonicalize()) { | 552 if (optimizer.Canonicalize()) { |
| 548 // To fully remove redundant boxing (e.g. BoxDouble used only in | 553 // To fully remove redundant boxing (e.g. BoxDouble used only in |
| 549 // environments and UnboxDouble instructions) instruction we | 554 // environments and UnboxDouble instructions) instruction we |
| 550 // first need to replace all their uses and then fold them away. | 555 // first need to replace all their uses and then fold them away. |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 const Object& result = | 1067 const Object& result = |
| 1063 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1068 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1064 isolate->object_store()->clear_sticky_error(); | 1069 isolate->object_store()->clear_sticky_error(); |
| 1065 return result.raw(); | 1070 return result.raw(); |
| 1066 } | 1071 } |
| 1067 UNREACHABLE(); | 1072 UNREACHABLE(); |
| 1068 return Object::null(); | 1073 return Object::null(); |
| 1069 } | 1074 } |
| 1070 | 1075 |
| 1071 } // namespace dart | 1076 } // namespace dart |
| OLD | NEW |