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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1400 Node* const node = value->InputAt(0); | 1400 Node* const node = value->InputAt(0); |
1401 Node* const result = NodeProperties::FindProjection(node, 0); | 1401 Node* const result = NodeProperties::FindProjection(node, 0); |
1402 if (result == nullptr || selector->IsDefined(result)) { | 1402 if (result == nullptr || selector->IsDefined(result)) { |
1403 switch (node->opcode()) { | 1403 switch (node->opcode()) { |
1404 case IrOpcode::kInt32AddWithOverflow: | 1404 case IrOpcode::kInt32AddWithOverflow: |
1405 cont->OverwriteAndNegateIfEqual(kOverflow); | 1405 cont->OverwriteAndNegateIfEqual(kOverflow); |
1406 return VisitBinop(selector, node, kIA32Add, cont); | 1406 return VisitBinop(selector, node, kIA32Add, cont); |
1407 case IrOpcode::kInt32SubWithOverflow: | 1407 case IrOpcode::kInt32SubWithOverflow: |
1408 cont->OverwriteAndNegateIfEqual(kOverflow); | 1408 cont->OverwriteAndNegateIfEqual(kOverflow); |
1409 return VisitBinop(selector, node, kIA32Sub, cont); | 1409 return VisitBinop(selector, node, kIA32Sub, cont); |
| 1410 case IrOpcode::kInt32MulWithOverflow: |
| 1411 cont->OverwriteAndNegateIfEqual(kOverflow); |
| 1412 return VisitBinop(selector, node, kIA32Imul, cont); |
1410 default: | 1413 default: |
1411 break; | 1414 break; |
1412 } | 1415 } |
1413 } | 1416 } |
1414 } | 1417 } |
1415 break; | 1418 break; |
1416 case IrOpcode::kInt32Sub: | 1419 case IrOpcode::kInt32Sub: |
1417 return VisitWordCompare(selector, value, cont); | 1420 return VisitWordCompare(selector, value, cont); |
1418 case IrOpcode::kWord32And: | 1421 case IrOpcode::kWord32And: |
1419 return VisitWordCompare(selector, value, kIA32Test, cont); | 1422 return VisitWordCompare(selector, value, kIA32Test, cont); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 | 1527 |
1525 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { | 1528 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { |
1526 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { | 1529 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
1527 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); | 1530 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
1528 return VisitBinop(this, node, kIA32Sub, &cont); | 1531 return VisitBinop(this, node, kIA32Sub, &cont); |
1529 } | 1532 } |
1530 FlagsContinuation cont; | 1533 FlagsContinuation cont; |
1531 VisitBinop(this, node, kIA32Sub, &cont); | 1534 VisitBinop(this, node, kIA32Sub, &cont); |
1532 } | 1535 } |
1533 | 1536 |
| 1537 void InstructionSelector::VisitInt32MulWithOverflow(Node* node) { |
| 1538 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
| 1539 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
| 1540 return VisitBinop(this, node, kIA32Imul, &cont); |
| 1541 } |
| 1542 FlagsContinuation cont; |
| 1543 VisitBinop(this, node, kIA32Imul, &cont); |
| 1544 } |
1534 | 1545 |
1535 void InstructionSelector::VisitFloat32Equal(Node* node) { | 1546 void InstructionSelector::VisitFloat32Equal(Node* node) { |
1536 FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node); | 1547 FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node); |
1537 VisitFloat32Compare(this, node, &cont); | 1548 VisitFloat32Compare(this, node, &cont); |
1538 } | 1549 } |
1539 | 1550 |
1540 | 1551 |
1541 void InstructionSelector::VisitFloat32LessThan(Node* node) { | 1552 void InstructionSelector::VisitFloat32LessThan(Node* node) { |
1542 FlagsContinuation cont = | 1553 FlagsContinuation cont = |
1543 FlagsContinuation::ForSet(kUnsignedGreaterThan, node); | 1554 FlagsContinuation::ForSet(kUnsignedGreaterThan, node); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 // static | 1701 // static |
1691 MachineOperatorBuilder::AlignmentRequirements | 1702 MachineOperatorBuilder::AlignmentRequirements |
1692 InstructionSelector::AlignmentRequirements() { | 1703 InstructionSelector::AlignmentRequirements() { |
1693 return MachineOperatorBuilder::AlignmentRequirements:: | 1704 return MachineOperatorBuilder::AlignmentRequirements:: |
1694 FullUnalignedAccessSupport(); | 1705 FullUnalignedAccessSupport(); |
1695 } | 1706 } |
1696 | 1707 |
1697 } // namespace compiler | 1708 } // namespace compiler |
1698 } // namespace internal | 1709 } // namespace internal |
1699 } // namespace v8 | 1710 } // namespace v8 |
OLD | NEW |