| 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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 for (int j = node->op()->EffectInputCount(); j > 0; ++i, j--) { | 266 for (int j = node->op()->EffectInputCount(); j > 0; ++i, j--) { |
| 267 Enqueue((*i).to()); // Effect inputs: just visit | 267 Enqueue((*i).to()); // Effect inputs: just visit |
| 268 } | 268 } |
| 269 for (int j = node->op()->ControlInputCount(); j > 0; ++i, j--) { | 269 for (int j = node->op()->ControlInputCount(); j > 0; ++i, j--) { |
| 270 Enqueue((*i).to()); // Control inputs: just visit | 270 Enqueue((*i).to()); // Control inputs: just visit |
| 271 } | 271 } |
| 272 DCHECK(i == node->input_edges().end()); | 272 DCHECK(i == node->input_edges().end()); |
| 273 SetOutput(node, kMachAnyTagged); | 273 SetOutput(node, kMachAnyTagged); |
| 274 } | 274 } |
| 275 | 275 |
| 276 // Helper for binops of the R x L -> O variety. |
| 277 void VisitBinop(Node* node, MachineTypeUnion left_use, |
| 278 MachineTypeUnion right_use, MachineTypeUnion output) { |
| 279 DCHECK_EQ(2, node->InputCount()); |
| 280 ProcessInput(node, 0, left_use); |
| 281 ProcessInput(node, 1, right_use); |
| 282 SetOutput(node, output); |
| 283 } |
| 284 |
| 276 // Helper for binops of the I x I -> O variety. | 285 // Helper for binops of the I x I -> O variety. |
| 277 void VisitBinop(Node* node, MachineTypeUnion input_use, | 286 void VisitBinop(Node* node, MachineTypeUnion input_use, |
| 278 MachineTypeUnion output) { | 287 MachineTypeUnion output) { |
| 279 DCHECK_EQ(2, node->InputCount()); | 288 VisitBinop(node, input_use, input_use, output); |
| 280 ProcessInput(node, 0, input_use); | |
| 281 ProcessInput(node, 1, input_use); | |
| 282 SetOutput(node, output); | |
| 283 } | 289 } |
| 284 | 290 |
| 285 // Helper for unops of the I -> O variety. | 291 // Helper for unops of the I -> O variety. |
| 286 void VisitUnop(Node* node, MachineTypeUnion input_use, | 292 void VisitUnop(Node* node, MachineTypeUnion input_use, |
| 287 MachineTypeUnion output) { | 293 MachineTypeUnion output) { |
| 288 DCHECK_EQ(1, node->InputCount()); | 294 DCHECK_EQ(1, node->InputCount()); |
| 289 ProcessInput(node, 0, input_use); | 295 ProcessInput(node, 0, input_use); |
| 290 SetOutput(node, output); | 296 SetOutput(node, output); |
| 291 } | 297 } |
| 292 | 298 |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 case IrOpcode::kFloat64Sqrt: | 1032 case IrOpcode::kFloat64Sqrt: |
| 1027 case IrOpcode::kFloat64Floor: | 1033 case IrOpcode::kFloat64Floor: |
| 1028 case IrOpcode::kFloat64Ceil: | 1034 case IrOpcode::kFloat64Ceil: |
| 1029 case IrOpcode::kFloat64RoundTruncate: | 1035 case IrOpcode::kFloat64RoundTruncate: |
| 1030 case IrOpcode::kFloat64RoundTiesAway: | 1036 case IrOpcode::kFloat64RoundTiesAway: |
| 1031 return VisitUnop(node, kMachFloat64, kMachFloat64); | 1037 return VisitUnop(node, kMachFloat64, kMachFloat64); |
| 1032 case IrOpcode::kFloat64Equal: | 1038 case IrOpcode::kFloat64Equal: |
| 1033 case IrOpcode::kFloat64LessThan: | 1039 case IrOpcode::kFloat64LessThan: |
| 1034 case IrOpcode::kFloat64LessThanOrEqual: | 1040 case IrOpcode::kFloat64LessThanOrEqual: |
| 1035 return VisitFloat64Cmp(node); | 1041 return VisitFloat64Cmp(node); |
| 1042 case IrOpcode::kFloat64ExtractWord32: |
| 1043 return VisitUnop(node, kMachFloat64, kMachInt32); |
| 1044 case IrOpcode::kFloat64InsertWord32: |
| 1045 return VisitBinop(node, kMachFloat64, kMachInt32, kMachFloat64); |
| 1036 case IrOpcode::kLoadStackPointer: | 1046 case IrOpcode::kLoadStackPointer: |
| 1037 return VisitLeaf(node, kMachPtr); | 1047 return VisitLeaf(node, kMachPtr); |
| 1038 case IrOpcode::kStateValues: | 1048 case IrOpcode::kStateValues: |
| 1039 for (int i = 0; i < node->InputCount(); i++) { | 1049 for (int i = 0; i < node->InputCount(); i++) { |
| 1040 ProcessInput(node, i, kTypeAny); | 1050 ProcessInput(node, i, kTypeAny); |
| 1041 } | 1051 } |
| 1042 SetOutput(node, kMachAnyTagged); | 1052 SetOutput(node, kMachAnyTagged); |
| 1043 break; | 1053 break; |
| 1044 default: | 1054 default: |
| 1045 VisitInputs(node); | 1055 VisitInputs(node); |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 | 1602 |
| 1593 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 1603 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
| 1594 node->set_op(machine()->IntLessThanOrEqual()); | 1604 node->set_op(machine()->IntLessThanOrEqual()); |
| 1595 node->ReplaceInput(0, StringComparison(node, true)); | 1605 node->ReplaceInput(0, StringComparison(node, true)); |
| 1596 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1606 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
| 1597 } | 1607 } |
| 1598 | 1608 |
| 1599 } // namespace compiler | 1609 } // namespace compiler |
| 1600 } // namespace internal | 1610 } // namespace internal |
| 1601 } // namespace v8 | 1611 } // namespace v8 |
| OLD | NEW |