| 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.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 GrowableArray<Value*>* values = current->env()->values_ptr(); | 95 GrowableArray<Value*>* values = current->env()->values_ptr(); |
| 96 | 96 |
| 97 for (intptr_t i = 0; i < values->length(); i++) { | 97 for (intptr_t i = 0; i < values->length(); i++) { |
| 98 UseVal* use = (*values)[i]->AsUse(); | 98 UseVal* use = (*values)[i]->AsUse(); |
| 99 if (use == NULL) continue; | 99 if (use == NULL) continue; |
| 100 | 100 |
| 101 Definition* def = use->definition(); | 101 Definition* def = use->definition(); |
| 102 | 102 |
| 103 PushArgumentInstr* push_argument = def->AsPushArgument(); | 103 PushArgumentInstr* push_argument = def->AsPushArgument(); |
| 104 if ((push_argument != NULL) && push_argument->WasEliminated()) { | 104 if ((push_argument != NULL) && push_argument->WasEliminated()) { |
| 105 // TODO(zerny): This should be unreachable if we could properly | 105 (*values)[i] = push_argument->value()->CopyValue(); |
| 106 // replace uses by values. (See RemovePushArguments in | |
| 107 // flow_graph_optimizer.cc). | |
| 108 (*values)[i] = push_argument->value(); | |
| 109 continue; | 106 continue; |
| 110 } | 107 } |
| 111 | 108 |
| 112 PhiInstr* phi = def->AsPhi(); | 109 PhiInstr* phi = def->AsPhi(); |
| 113 if ((phi != NULL) && !phi->is_alive()) { | 110 if ((phi != NULL) && !phi->is_alive()) { |
| 114 (*values)[i] = null_value; | 111 (*values)[i] = null_value; |
| 115 continue; | 112 continue; |
| 116 } | 113 } |
| 117 } | 114 } |
| 118 } else { | 115 } else { |
| (...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2030 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2034 function.ToFullyQualifiedCString()); | 2031 function.ToFullyQualifiedCString()); |
| 2035 FlowGraphPrinter printer(flow_graph_, true); | 2032 FlowGraphPrinter printer(flow_graph_, true); |
| 2036 printer.PrintBlocks(); | 2033 printer.PrintBlocks(); |
| 2037 OS::Print("----------------------------------------------\n"); | 2034 OS::Print("----------------------------------------------\n"); |
| 2038 } | 2035 } |
| 2039 } | 2036 } |
| 2040 | 2037 |
| 2041 | 2038 |
| 2042 } // namespace dart | 2039 } // namespace dart |
| OLD | NEW |