| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // nothing to do | 145 // nothing to do |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 DCHECK_EQ(IrOpcode::kMerge, final_merge->opcode()); | 148 DCHECK_EQ(IrOpcode::kMerge, final_merge->opcode()); |
| 149 | 149 |
| 150 int predecessors = | 150 int predecessors = |
| 151 OperatorProperties::GetControlInputCount(final_merge->op()); | 151 OperatorProperties::GetControlInputCount(final_merge->op()); |
| 152 Operator* op_phi = jsgraph_->common()->Phi(predecessors); | 152 Operator* op_phi = jsgraph_->common()->Phi(predecessors); |
| 153 Operator* op_ephi = jsgraph_->common()->EffectPhi(predecessors); | 153 Operator* op_ephi = jsgraph_->common()->EffectPhi(predecessors); |
| 154 | 154 |
| 155 NodeVector values(NodeVector::allocator_type(jsgraph_->zone())); | 155 NodeVector values(jsgraph_->zone()); |
| 156 NodeVector effects(NodeVector::allocator_type(jsgraph_->zone())); | 156 NodeVector effects(jsgraph_->zone()); |
| 157 // Iterate over all control flow predecessors, | 157 // Iterate over all control flow predecessors, |
| 158 // which must be return statements. | 158 // which must be return statements. |
| 159 InputIter iter = final_merge->inputs().begin(); | 159 InputIter iter = final_merge->inputs().begin(); |
| 160 while (iter != final_merge->inputs().end()) { | 160 while (iter != final_merge->inputs().end()) { |
| 161 Node* input = *iter; | 161 Node* input = *iter; |
| 162 switch (input->opcode()) { | 162 switch (input->opcode()) { |
| 163 case IrOpcode::kReturn: | 163 case IrOpcode::kReturn: |
| 164 values.push_back(NodeProperties::GetValueInput(input, 0)); | 164 values.push_back(NodeProperties::GetValueInput(input, 0)); |
| 165 effects.push_back(NodeProperties::GetEffectInput(input)); | 165 effects.push_back(NodeProperties::GetEffectInput(input)); |
| 166 iter.UpdateToAndIncrement(NodeProperties::GetControlInput(input)); | 166 iter.UpdateToAndIncrement(NodeProperties::GetControlInput(input)); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 Inlinee inlinee(&jsgraph); | 321 Inlinee inlinee(&jsgraph); |
| 322 inlinee.UnifyReturn(); | 322 inlinee.UnifyReturn(); |
| 323 inlinee.InlineAtCall(jsgraph_, node); | 323 inlinee.InlineAtCall(jsgraph_, node); |
| 324 | 324 |
| 325 jsgraph_->graph()->SetNextNodeId(inlinee.graph()->NextNodeID()); | 325 jsgraph_->graph()->SetNextNodeId(inlinee.graph()->NextNodeID()); |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 } // namespace v8::internal::compiler | 329 } // namespace v8::internal::compiler |
| OLD | NEW |