OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/generic-node-inl.h" | 7 #include "src/compiler/generic-node-inl.h" |
8 #include "src/compiler/graph-inl.h" | 8 #include "src/compiler/graph-inl.h" |
9 #include "src/compiler/graph-visualizer.h" | 9 #include "src/compiler/graph-visualizer.h" |
10 #include "src/compiler/js-inlining.h" | 10 #include "src/compiler/js-inlining.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 Node* final_merge = NodeProperties::GetControlInput(graph->end(), 0); | 114 Node* final_merge = NodeProperties::GetControlInput(graph->end(), 0); |
115 if (final_merge->opcode() == IrOpcode::kReturn) { | 115 if (final_merge->opcode() == IrOpcode::kReturn) { |
116 // nothing to do | 116 // nothing to do |
117 return; | 117 return; |
118 } | 118 } |
119 DCHECK_EQ(IrOpcode::kMerge, final_merge->opcode()); | 119 DCHECK_EQ(IrOpcode::kMerge, final_merge->opcode()); |
120 | 120 |
121 int predecessors = | 121 int predecessors = |
122 OperatorProperties::GetControlInputCount(final_merge->op()); | 122 OperatorProperties::GetControlInputCount(final_merge->op()); |
123 Operator* op_phi = jsgraph_->common()->Phi(kMachAnyTagged, predecessors); | 123 const Operator* op_phi = |
124 Operator* op_ephi = jsgraph_->common()->EffectPhi(predecessors); | 124 jsgraph_->common()->Phi(kMachAnyTagged, predecessors); |
| 125 const Operator* op_ephi = jsgraph_->common()->EffectPhi(predecessors); |
125 | 126 |
126 NodeVector values(jsgraph_->zone()); | 127 NodeVector values(jsgraph_->zone()); |
127 NodeVector effects(jsgraph_->zone()); | 128 NodeVector effects(jsgraph_->zone()); |
128 // Iterate over all control flow predecessors, | 129 // Iterate over all control flow predecessors, |
129 // which must be return statements. | 130 // which must be return statements. |
130 InputIter iter = final_merge->inputs().begin(); | 131 InputIter iter = final_merge->inputs().begin(); |
131 while (iter != final_merge->inputs().end()) { | 132 while (iter != final_merge->inputs().end()) { |
132 Node* input = *iter; | 133 Node* input = *iter; |
133 switch (input->opcode()) { | 134 switch (input->opcode()) { |
134 case IrOpcode::kReturn: | 135 case IrOpcode::kReturn: |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 288 |
288 Inlinee inlinee(&jsgraph); | 289 Inlinee inlinee(&jsgraph); |
289 inlinee.UnifyReturn(); | 290 inlinee.UnifyReturn(); |
290 inlinee.InlineAtCall(jsgraph_, node); | 291 inlinee.InlineAtCall(jsgraph_, node); |
291 | 292 |
292 jsgraph_->graph()->SetNextNodeId(inlinee.graph()->NextNodeID()); | 293 jsgraph_->graph()->SetNextNodeId(inlinee.graph()->NextNodeID()); |
293 } | 294 } |
294 } | 295 } |
295 } | 296 } |
296 } // namespace v8::internal::compiler | 297 } // namespace v8::internal::compiler |
OLD | NEW |