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/js-inlining.h" | 5 #include "src/compiler/js-inlining.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 for (Node* const input : end->inputs()) { | 172 for (Node* const input : end->inputs()) { |
173 switch (input->opcode()) { | 173 switch (input->opcode()) { |
174 case IrOpcode::kReturn: | 174 case IrOpcode::kReturn: |
175 values.push_back(NodeProperties::GetValueInput(input, 0)); | 175 values.push_back(NodeProperties::GetValueInput(input, 0)); |
176 effects.push_back(NodeProperties::GetEffectInput(input)); | 176 effects.push_back(NodeProperties::GetEffectInput(input)); |
177 controls.push_back(NodeProperties::GetControlInput(input)); | 177 controls.push_back(NodeProperties::GetControlInput(input)); |
178 break; | 178 break; |
179 case IrOpcode::kDeoptimize: | 179 case IrOpcode::kDeoptimize: |
180 case IrOpcode::kTerminate: | 180 case IrOpcode::kTerminate: |
181 case IrOpcode::kThrow: | 181 case IrOpcode::kThrow: |
182 jsgraph_->graph()->end()->AppendInput(jsgraph_->zone(), input); | 182 NodeProperties::MergeControlToEnd(jsgraph_->graph(), jsgraph_->common(), |
183 jsgraph_->graph()->end()->set_op( | 183 input); |
184 jsgraph_->common()->End(jsgraph_->graph()->end()->InputCount())); | |
185 break; | 184 break; |
186 default: | 185 default: |
187 UNREACHABLE(); | 186 UNREACHABLE(); |
188 break; | 187 break; |
189 } | 188 } |
190 } | 189 } |
191 DCHECK_EQ(values.size(), effects.size()); | 190 DCHECK_EQ(values.size(), effects.size()); |
192 DCHECK_EQ(values.size(), controls.size()); | 191 DCHECK_EQ(values.size(), controls.size()); |
193 | 192 |
194 // Depending on whether the inlinee produces a value, we either replace value | 193 // Depending on whether the inlinee produces a value, we either replace value |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 355 |
357 // Remember that we inlined this function. | 356 // Remember that we inlined this function. |
358 info_->AddInlinedFunction(info.shared_info()); | 357 info_->AddInlinedFunction(info.shared_info()); |
359 | 358 |
360 return InlineCall(node, context, frame_state, start, end); | 359 return InlineCall(node, context, frame_state, start, end); |
361 } | 360 } |
362 | 361 |
363 } // namespace compiler | 362 } // namespace compiler |
364 } // namespace internal | 363 } // namespace internal |
365 } // namespace v8 | 364 } // namespace v8 |
OLD | NEW |