Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/compiler/int64-lowering.cc

Issue 2490973002: [turbofan] Fix -Wsign-compare warnings. (Closed)
Patch Set: fix dcheck Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/escape-analysis.cc ('k') | src/compiler/simd-scalar-lowering.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/diamond.h" 7 #include "src/compiler/diamond.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } else { 235 } else {
236 if (HasReplacementLow(node->InputAt(2))) { 236 if (HasReplacementLow(node->InputAt(2))) {
237 node->ReplaceInput(2, GetReplacementLow(node->InputAt(2))); 237 node->ReplaceInput(2, GetReplacementLow(node->InputAt(2)));
238 } 238 }
239 } 239 }
240 break; 240 break;
241 } 241 }
242 case IrOpcode::kStart: { 242 case IrOpcode::kStart: {
243 int parameter_count = GetParameterCountAfterLowering(signature()); 243 int parameter_count = GetParameterCountAfterLowering(signature());
244 // Only exchange the node if the parameter count actually changed. 244 // Only exchange the node if the parameter count actually changed.
245 if (parameter_count != signature()->parameter_count()) { 245 if (parameter_count != static_cast<int>(signature()->parameter_count())) {
246 int delta = 246 int delta =
247 parameter_count - static_cast<int>(signature()->parameter_count()); 247 parameter_count - static_cast<int>(signature()->parameter_count());
248 int new_output_count = node->op()->ValueOutputCount() + delta; 248 int new_output_count = node->op()->ValueOutputCount() + delta;
249 NodeProperties::ChangeOp(node, common()->Start(new_output_count)); 249 NodeProperties::ChangeOp(node, common()->Start(new_output_count));
250 } 250 }
251 break; 251 break;
252 } 252 }
253 case IrOpcode::kParameter: { 253 case IrOpcode::kParameter: {
254 DCHECK(node->InputCount() == 1); 254 DCHECK(node->InputCount() == 1);
255 // Only exchange the node if the parameter count actually changed. We do 255 // Only exchange the node if the parameter count actually changed. We do
256 // not even have to do the default lowering because the the start node, 256 // not even have to do the default lowering because the the start node,
257 // the only input of a parameter node, only changes if the parameter count 257 // the only input of a parameter node, only changes if the parameter count
258 // changes. 258 // changes.
259 if (GetParameterCountAfterLowering(signature()) != 259 if (GetParameterCountAfterLowering(signature()) !=
260 signature()->parameter_count()) { 260 static_cast<int>(signature()->parameter_count())) {
261 int old_index = ParameterIndexOf(node->op()); 261 int old_index = ParameterIndexOf(node->op());
262 int new_index = GetParameterIndexAfterLowering(signature(), old_index); 262 int new_index = GetParameterIndexAfterLowering(signature(), old_index);
263 NodeProperties::ChangeOp(node, common()->Parameter(new_index)); 263 NodeProperties::ChangeOp(node, common()->Parameter(new_index));
264 264
265 Node* high_node = nullptr; 265 Node* high_node = nullptr;
266 if (signature()->GetParam(old_index) == 266 if (signature()->GetParam(old_index) ==
267 MachineRepresentation::kWord64) { 267 MachineRepresentation::kWord64) {
268 high_node = graph()->NewNode(common()->Parameter(new_index + 1), 268 high_node = graph()->NewNode(common()->Parameter(new_index + 1),
269 graph()->start()); 269 graph()->start());
270 } 270 }
271 ReplaceNode(node, node, high_node); 271 ReplaceNode(node, node, high_node);
272 } 272 }
273 break; 273 break;
274 } 274 }
275 case IrOpcode::kReturn: { 275 case IrOpcode::kReturn: {
276 DefaultLowering(node); 276 DefaultLowering(node);
277 int new_return_count = GetReturnCountAfterLowering(signature()); 277 int new_return_count = GetReturnCountAfterLowering(signature());
278 if (signature()->return_count() != new_return_count) { 278 if (static_cast<int>(signature()->return_count()) != new_return_count) {
279 NodeProperties::ChangeOp(node, common()->Return(new_return_count)); 279 NodeProperties::ChangeOp(node, common()->Return(new_return_count));
280 } 280 }
281 break; 281 break;
282 } 282 }
283 case IrOpcode::kCall: { 283 case IrOpcode::kCall: {
284 // TODO(turbofan): Make WASM code const-correct wrt. CallDescriptor. 284 // TODO(turbofan): Make WASM code const-correct wrt. CallDescriptor.
285 CallDescriptor* descriptor = 285 CallDescriptor* descriptor =
286 const_cast<CallDescriptor*>(CallDescriptorOf(node->op())); 286 const_cast<CallDescriptor*>(CallDescriptorOf(node->op()));
287 if (DefaultLowering(node) || 287 if (DefaultLowering(node) ||
288 (descriptor->ReturnCount() == 1 && 288 (descriptor->ReturnCount() == 1 &&
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 common()->Phi(MachineRepresentation::kWord32, value_count), 888 common()->Phi(MachineRepresentation::kWord32, value_count),
889 value_count + 1, inputs_low, false), 889 value_count + 1, inputs_low, false),
890 graph()->NewNode( 890 graph()->NewNode(
891 common()->Phi(MachineRepresentation::kWord32, value_count), 891 common()->Phi(MachineRepresentation::kWord32, value_count),
892 value_count + 1, inputs_high, false)); 892 value_count + 1, inputs_high, false));
893 } 893 }
894 } 894 }
895 } // namespace compiler 895 } // namespace compiler
896 } // namespace internal 896 } // namespace internal
897 } // namespace v8 897 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/escape-analysis.cc ('k') | src/compiler/simd-scalar-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698