| 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/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
| 6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
| 7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 case IrOpcode::kParameter: { | 202 case IrOpcode::kParameter: { |
| 203 DCHECK(node->InputCount() == 1); | 203 DCHECK(node->InputCount() == 1); |
| 204 // Only exchange the node if the parameter count actually changed. We do | 204 // Only exchange the node if the parameter count actually changed. We do |
| 205 // not even have to do the default lowering because the the start node, | 205 // not even have to do the default lowering because the the start node, |
| 206 // the only input of a parameter node, only changes if the parameter count | 206 // the only input of a parameter node, only changes if the parameter count |
| 207 // changes. | 207 // changes. |
| 208 if (GetParameterCountAfterLowering(signature()) != | 208 if (GetParameterCountAfterLowering(signature()) != |
| 209 signature()->parameter_count()) { | 209 signature()->parameter_count()) { |
| 210 int old_index = ParameterIndexOf(node->op()); | 210 int old_index = ParameterIndexOf(node->op()); |
| 211 int new_index = GetParameterIndexAfterLowering(signature(), old_index); | 211 int new_index = GetParameterIndexAfterLowering(signature(), old_index); |
| 212 // TODO(ahaas): Use NodeProperties::ChangeOp here instead of allocating |
| 213 // a new node. |
| 212 Node* low_node = | 214 Node* low_node = |
| 213 graph()->NewNode(common()->Parameter(new_index), graph()->start()); | 215 graph()->NewNode(common()->Parameter(new_index), graph()->start()); |
| 214 | 216 |
| 215 Node* high_node = nullptr; | 217 Node* high_node = nullptr; |
| 216 if (signature()->GetParam(old_index) == | 218 if (signature()->GetParam(old_index) == |
| 217 MachineRepresentation::kWord64) { | 219 MachineRepresentation::kWord64) { |
| 218 high_node = graph()->NewNode(common()->Parameter(new_index + 1), | 220 high_node = graph()->NewNode(common()->Parameter(new_index + 1), |
| 219 graph()->start()); | 221 graph()->start()); |
| 220 } | 222 } |
| 221 ReplaceNode(node, low_node, high_node); | 223 ReplaceNode(node, low_node, high_node); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 293 } |
| 292 | 294 |
| 293 Node* Int64Lowering::GetReplacementHigh(Node* node) { | 295 Node* Int64Lowering::GetReplacementHigh(Node* node) { |
| 294 Node* result = replacements_[node->id()].high; | 296 Node* result = replacements_[node->id()].high; |
| 295 DCHECK(result); | 297 DCHECK(result); |
| 296 return result; | 298 return result; |
| 297 } | 299 } |
| 298 } // namespace compiler | 300 } // namespace compiler |
| 299 } // namespace internal | 301 } // namespace internal |
| 300 } // namespace v8 | 302 } // namespace v8 |
| OLD | NEW |