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/flow_graph.h" | 5 #include "vm/flow_graph.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 } | 487 } |
488 | 488 |
489 | 489 |
490 void FlowGraph::Rename(GrowableArray<PhiInstr*>* live_phis) { | 490 void FlowGraph::Rename(GrowableArray<PhiInstr*>* live_phis) { |
491 // TODO(fschneider): Support catch-entry. | 491 // TODO(fschneider): Support catch-entry. |
492 if (graph_entry_->SuccessorCount() > 1) { | 492 if (graph_entry_->SuccessorCount() > 1) { |
493 Bailout("Catch-entry support in SSA."); | 493 Bailout("Catch-entry support in SSA."); |
494 } | 494 } |
495 | 495 |
496 // Name global constants. | 496 // Name global constants. |
497 graph_entry_->constant_null()->set_ssa_temp_index(alloc_ssa_temp_index()); | 497 ConstantInstr* constant_null = new ConstantInstr(Object::ZoneHandle()); |
| 498 constant_null->set_ssa_temp_index(alloc_ssa_temp_index()); |
| 499 graph_entry_->set_constant_null(constant_null); |
498 | 500 |
499 // Initialize start environment. | 501 // Initialize start environment. |
500 GrowableArray<Definition*> start_env(variable_count()); | 502 GrowableArray<Definition*> start_env(variable_count()); |
501 for (intptr_t i = 0; i < parameter_count(); ++i) { | 503 for (intptr_t i = 0; i < parameter_count(); ++i) { |
502 ParameterInstr* param = new ParameterInstr(i, graph_entry_); | 504 ParameterInstr* param = new ParameterInstr(i, graph_entry_); |
503 param->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp. | 505 param->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp. |
504 start_env.Add(param); | 506 start_env.Add(param); |
505 } | 507 } |
506 | 508 |
507 // All locals are initialized with #null. Use the global definition, uses | 509 // All locals are initialized with #null. Use the global definition, uses |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 // Remove original arguments to the call. | 794 // Remove original arguments to the call. |
793 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { | 795 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { |
794 PushArgumentInstr* push = call->ArgumentAt(i); | 796 PushArgumentInstr* push = call->ArgumentAt(i); |
795 push->ReplaceUsesWith(push->value()->definition()); | 797 push->ReplaceUsesWith(push->value()->definition()); |
796 push->RemoveFromGraph(); | 798 push->RemoveFromGraph(); |
797 } | 799 } |
798 } | 800 } |
799 | 801 |
800 | 802 |
801 } // namespace dart | 803 } // namespace dart |
OLD | NEW |