| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/store-store-elimination.h" | 5 #include "src/compiler/store-store-elimination.h" |
| 6 | 6 |
| 7 #include "src/compiler/all-nodes.h" | 7 #include "src/compiler/all-nodes.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // | 123 // |
| 124 // Because the elimination removes nodes from the graph, even remove nodes | 124 // Because the elimination removes nodes from the graph, even remove nodes |
| 125 // that the elimination was not invoked on, we cannot use a normal | 125 // that the elimination was not invoked on, we cannot use a normal |
| 126 // AdvancedReducer but we manually find which nodes to invoke the | 126 // AdvancedReducer but we manually find which nodes to invoke the |
| 127 // elimination on. Then in a next step, we invoke the elimination for each | 127 // elimination on. Then in a next step, we invoke the elimination for each |
| 128 // node that was eligible. | 128 // node that was eligible. |
| 129 | 129 |
| 130 NodeVector eligible(temp_zone()); // loops over all nodes | 130 NodeVector eligible(temp_zone()); // loops over all nodes |
| 131 AllNodes all(temp_zone(), jsgraph()->graph()); | 131 AllNodes all(temp_zone(), jsgraph()->graph()); |
| 132 | 132 |
| 133 for (Node* node : all.live) { | 133 for (Node* node : all.reachable) { |
| 134 if (IsEligibleNode(node)) { | 134 if (IsEligibleNode(node)) { |
| 135 eligible.push_back(node); | 135 eligible.push_back(node); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 for (Node* node : eligible) { | 139 for (Node* node : eligible) { |
| 140 ReduceEligibleNode(node); | 140 ReduceEligibleNode(node); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 current_node = previous; | 312 current_node = previous; |
| 313 } while (current_node != nullptr && | 313 } while (current_node != nullptr && |
| 314 current_node->op()->opcode() == IrOpcode::kStoreField); | 314 current_node->op()->opcode() == IrOpcode::kStoreField); |
| 315 | 315 |
| 316 TRACE("finished"); | 316 TRACE("finished"); |
| 317 } | 317 } |
| 318 | 318 |
| 319 } // namespace compiler | 319 } // namespace compiler |
| 320 } // namespace internal | 320 } // namespace internal |
| 321 } // namespace v8 | 321 } // namespace v8 |
| OLD | NEW |