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 ConstantInstr* constant_null = new ConstantInstr(Object::ZoneHandle()); | 497 graph_entry_->constant_null()->set_ssa_temp_index(alloc_ssa_temp_index()); |
498 constant_null->set_ssa_temp_index(alloc_ssa_temp_index()); | |
499 graph_entry_->set_constant_null(constant_null); | |
500 | 498 |
501 // Initialize start environment. | 499 // Initialize start environment. |
502 GrowableArray<Definition*> start_env(variable_count()); | 500 GrowableArray<Definition*> start_env(variable_count()); |
503 for (intptr_t i = 0; i < parameter_count(); ++i) { | 501 for (intptr_t i = 0; i < parameter_count(); ++i) { |
504 ParameterInstr* param = new ParameterInstr(i, graph_entry_); | 502 ParameterInstr* param = new ParameterInstr(i, graph_entry_); |
505 param->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp. | 503 param->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp. |
506 start_env.Add(param); | 504 start_env.Add(param); |
507 } | 505 } |
508 | 506 |
509 // All locals are initialized with #null. Use the global definition, uses | 507 // All locals are initialized with #null. Use the global definition, uses |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 // Remove original arguments to the call. | 792 // Remove original arguments to the call. |
795 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { | 793 for (intptr_t i = 0; i < call->ArgumentCount(); ++i) { |
796 PushArgumentInstr* push = call->ArgumentAt(i); | 794 PushArgumentInstr* push = call->ArgumentAt(i); |
797 push->ReplaceUsesWith(push->value()->definition()); | 795 push->ReplaceUsesWith(push->value()->definition()); |
798 push->RemoveFromGraph(); | 796 push->RemoveFromGraph(); |
799 } | 797 } |
800 } | 798 } |
801 | 799 |
802 | 800 |
803 } // namespace dart | 801 } // namespace dart |
OLD | NEW |