| 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/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 optimizer.EliminateEnvironments(); | 438 optimizer.EliminateEnvironments(); |
| 439 | 439 |
| 440 // Attempt to sink allocations of temporary non-escaping objects to | 440 // Attempt to sink allocations of temporary non-escaping objects to |
| 441 // the deoptimization path. | 441 // the deoptimization path. |
| 442 AllocationSinking* sinking = NULL; | 442 AllocationSinking* sinking = NULL; |
| 443 if (FLAG_allocation_sinking) { | 443 if (FLAG_allocation_sinking) { |
| 444 sinking = new AllocationSinking(flow_graph); | 444 sinking = new AllocationSinking(flow_graph); |
| 445 sinking->Optimize(); | 445 sinking->Optimize(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 // Ensure that all phis inserted by optimization passes have consistent |
| 449 // representations. |
| 450 optimizer.UnboxPhis(); |
| 451 |
| 448 if (optimizer.Canonicalize()) { | 452 if (optimizer.Canonicalize()) { |
| 449 // To fully remove redundant boxing (e.g. BoxDouble used only in | 453 // To fully remove redundant boxing (e.g. BoxDouble used only in |
| 450 // environments and UnboxDouble instructions) instruction we | 454 // environments and UnboxDouble instructions) instruction we |
| 451 // first need to replace all their uses and then fold them away. | 455 // first need to replace all their uses and then fold them away. |
| 452 // For now we just repeat Canonicalize twice to do that. | 456 // For now we just repeat Canonicalize twice to do that. |
| 453 // TODO(vegorov): implement a separate representation folding pass. | 457 // TODO(vegorov): implement a separate representation folding pass. |
| 454 optimizer.Canonicalize(); | 458 optimizer.Canonicalize(); |
| 455 } | 459 } |
| 456 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 460 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 457 | 461 |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 Object::Handle(isolate->object_store()->sticky_error()); | 871 Object::Handle(isolate->object_store()->sticky_error()); |
| 868 isolate->object_store()->clear_sticky_error(); | 872 isolate->object_store()->clear_sticky_error(); |
| 869 isolate->set_long_jump_base(base); | 873 isolate->set_long_jump_base(base); |
| 870 return result.raw(); | 874 return result.raw(); |
| 871 } | 875 } |
| 872 UNREACHABLE(); | 876 UNREACHABLE(); |
| 873 return Object::null(); | 877 return Object::null(); |
| 874 } | 878 } |
| 875 | 879 |
| 876 } // namespace dart | 880 } // namespace dart |
| OLD | NEW |