| 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_allocator.h" | 5 #include "vm/flow_graph_allocator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 GrowableArray<Value*>* values = current->env()->values_ptr(); | 97 GrowableArray<Value*>* values = current->env()->values_ptr(); |
| 98 | 98 |
| 99 for (intptr_t i = 0; i < values->length(); i++) { | 99 for (intptr_t i = 0; i < values->length(); i++) { |
| 100 UseVal* use = (*values)[i]->AsUse(); | 100 UseVal* use = (*values)[i]->AsUse(); |
| 101 if (use == NULL) continue; | 101 if (use == NULL) continue; |
| 102 | 102 |
| 103 Definition* def = use->definition(); | 103 Definition* def = use->definition(); |
| 104 | 104 |
| 105 PushArgumentInstr* push_argument = def->AsPushArgument(); | 105 PushArgumentInstr* push_argument = def->AsPushArgument(); |
| 106 if ((push_argument != NULL) && push_argument->WasEliminated()) { | 106 if ((push_argument != NULL) && push_argument->WasEliminated()) { |
| 107 // TODO(zerny): This should be unreachable if we could properly |
| 108 // replace uses by values. (See RemovePushArguments in |
| 109 // flow_graph_optimizer.cc). |
| 107 (*values)[i] = push_argument->value(); | 110 (*values)[i] = push_argument->value(); |
| 108 continue; | 111 continue; |
| 109 } | 112 } |
| 110 | 113 |
| 111 PhiInstr* phi = def->AsPhi(); | 114 PhiInstr* phi = def->AsPhi(); |
| 112 if ((phi != NULL) && !phi->is_alive()) { | 115 if ((phi != NULL) && !phi->is_alive()) { |
| 113 (*values)[i] = null_value; | 116 (*values)[i] = null_value; |
| 114 continue; | 117 continue; |
| 115 } | 118 } |
| 116 } | 119 } |
| (...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2038 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2036 function.ToFullyQualifiedCString()); | 2039 function.ToFullyQualifiedCString()); |
| 2037 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 2040 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 2038 printer.PrintBlocks(); | 2041 printer.PrintBlocks(); |
| 2039 OS::Print("----------------------------------------------\n"); | 2042 OS::Print("----------------------------------------------\n"); |
| 2040 } | 2043 } |
| 2041 } | 2044 } |
| 2042 | 2045 |
| 2043 | 2046 |
| 2044 } // namespace dart | 2047 } // namespace dart |
| OLD | NEW |