OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/loop-peeling.h" | 7 #include "src/compiler/loop-peeling.h" |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/compiler/node-marker.h" | 9 #include "src/compiler/node-marker.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (exits.size() != 1) return nullptr; // not peelable currently. | 205 if (exits.size() != 1) return nullptr; // not peelable currently. |
206 | 206 |
207 //============================================================================ | 207 //============================================================================ |
208 // Construct the peeled iteration. | 208 // Construct the peeled iteration. |
209 //============================================================================ | 209 //============================================================================ |
210 PeeledIterationImpl* iter = new (tmp_zone) PeeledIterationImpl(tmp_zone); | 210 PeeledIterationImpl* iter = new (tmp_zone) PeeledIterationImpl(tmp_zone); |
211 size_t estimated_peeled_size = | 211 size_t estimated_peeled_size = |
212 5 + (loop->TotalSize() + exits.size() + rets.size()) * 2; | 212 5 + (loop->TotalSize() + exits.size() + rets.size()) * 2; |
213 Peeling peeling(graph, tmp_zone, estimated_peeled_size, &iter->node_pairs_); | 213 Peeling peeling(graph, tmp_zone, estimated_peeled_size, &iter->node_pairs_); |
214 | 214 |
215 Node* dead = graph->NewNode(common->Dead()); | 215 Node* dead = graph->NewNode(common->DeadControl()); |
216 | 216 |
217 // Map the loop header nodes to their entry values. | 217 // Map the loop header nodes to their entry values. |
218 for (Node* node : loop_tree->HeaderNodes(loop)) { | 218 for (Node* node : loop_tree->HeaderNodes(loop)) { |
219 peeling.Insert(node, node->InputAt(kAssumedLoopEntryIndex)); | 219 peeling.Insert(node, node->InputAt(kAssumedLoopEntryIndex)); |
220 } | 220 } |
221 | 221 |
222 // Copy all the nodes of loop body for the peeled iteration. | 222 // Copy all the nodes of loop body for the peeled iteration. |
223 peeling.CopyNodes(graph, tmp_zone, dead, loop_tree->BodyNodes(loop)); | 223 peeling.CopyNodes(graph, tmp_zone, dead, loop_tree->BodyNodes(loop)); |
224 | 224 |
225 //============================================================================ | 225 //============================================================================ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 324 } |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 return iter; | 328 return iter; |
329 } | 329 } |
330 | 330 |
331 } // namespace compiler | 331 } // namespace compiler |
332 } // namespace internal | 332 } // namespace internal |
333 } // namespace v8 | 333 } // namespace v8 |
OLD | NEW |