| 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/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
| 6 | 6 |
| 7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
| 8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
| 9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
| 10 | 10 |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 word == MachineRepresentation::kWord64); | 594 word == MachineRepresentation::kWord64); |
| 595 } | 595 } |
| 596 | 596 |
| 597 | 597 |
| 598 #define PURE(Name, properties, value_input_count, control_input_count, \ | 598 #define PURE(Name, properties, value_input_count, control_input_count, \ |
| 599 output_count) \ | 599 output_count) \ |
| 600 const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; } | 600 const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; } |
| 601 PURE_OP_LIST(PURE) | 601 PURE_OP_LIST(PURE) |
| 602 #undef PURE | 602 #undef PURE |
| 603 | 603 |
| 604 #define PURE(Name, properties, value_input_count, control_input_count, \ | 604 #define PURE(Name, properties, value_input_count, control_input_count, \ |
| 605 output_count) \ | 605 output_count) \ |
| 606 const OptionalOperator MachineOperatorBuilder::Name() { \ | 606 const OptionalOperator MachineOperatorBuilder::Name() { \ |
| 607 return OptionalOperator(flags_ & k##Name ? &cache_.k##Name : nullptr); \ | 607 return OptionalOperator(flags_ & k##Name, &cache_.k##Name); \ |
| 608 } | 608 } |
| 609 PURE_OPTIONAL_OP_LIST(PURE) | 609 PURE_OPTIONAL_OP_LIST(PURE) |
| 610 #undef PURE | 610 #undef PURE |
| 611 | 611 |
| 612 #define OVERFLOW_OP(Name, properties) \ | 612 #define OVERFLOW_OP(Name, properties) \ |
| 613 const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; } | 613 const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; } |
| 614 OVERFLOW_OP_LIST(OVERFLOW_OP) | 614 OVERFLOW_OP_LIST(OVERFLOW_OP) |
| 615 #undef OVERFLOW_OP | 615 #undef OVERFLOW_OP |
| 616 | 616 |
| 617 const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) { | 617 const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 MACHINE_REPRESENTATION_LIST(STORE) | 691 MACHINE_REPRESENTATION_LIST(STORE) |
| 692 #undef STORE | 692 #undef STORE |
| 693 case MachineRepresentation::kBit: | 693 case MachineRepresentation::kBit: |
| 694 case MachineRepresentation::kNone: | 694 case MachineRepresentation::kNone: |
| 695 break; | 695 break; |
| 696 } | 696 } |
| 697 UNREACHABLE(); | 697 UNREACHABLE(); |
| 698 return nullptr; | 698 return nullptr; |
| 699 } | 699 } |
| 700 | 700 |
| 701 // On 32 bit platforms we need to get a reference to optional operators of | |
| 702 // 64-bit instructions for later Int64Lowering, even though 32 bit platforms | |
| 703 // don't support the original 64-bit instruction. | |
| 704 const Operator* MachineOperatorBuilder::Word64PopcntPlaceholder() { | |
| 705 return &cache_.kWord64Popcnt; | |
| 706 } | |
| 707 | |
| 708 // On 32 bit platforms we need to get a reference to optional operators of | |
| 709 // 64-bit instructions for later Int64Lowering, even though 32 bit platforms | |
| 710 // don't support the original 64-bit instruction. | |
| 711 const Operator* MachineOperatorBuilder::Word64CtzPlaceholder() { | |
| 712 return &cache_.kWord64Ctz; | |
| 713 } | |
| 714 | |
| 715 const Operator* MachineOperatorBuilder::AtomicLoad(LoadRepresentation rep) { | 701 const Operator* MachineOperatorBuilder::AtomicLoad(LoadRepresentation rep) { |
| 716 #define LOAD(Type) \ | 702 #define LOAD(Type) \ |
| 717 if (rep == MachineType::Type()) { \ | 703 if (rep == MachineType::Type()) { \ |
| 718 return &cache_.kAtomicLoad##Type; \ | 704 return &cache_.kAtomicLoad##Type; \ |
| 719 } | 705 } |
| 720 ATOMIC_TYPE_LIST(LOAD) | 706 ATOMIC_TYPE_LIST(LOAD) |
| 721 #undef LOAD | 707 #undef LOAD |
| 722 UNREACHABLE(); | 708 UNREACHABLE(); |
| 723 return nullptr; | 709 return nullptr; |
| 724 } | 710 } |
| 725 | 711 |
| 726 const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) { | 712 const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) { |
| 727 #define STORE(kRep) \ | 713 #define STORE(kRep) \ |
| 728 if (rep == MachineRepresentation::kRep) { \ | 714 if (rep == MachineRepresentation::kRep) { \ |
| 729 return &cache_.kAtomicStore##kRep; \ | 715 return &cache_.kAtomicStore##kRep; \ |
| 730 } | 716 } |
| 731 ATOMIC_REPRESENTATION_LIST(STORE) | 717 ATOMIC_REPRESENTATION_LIST(STORE) |
| 732 #undef STORE | 718 #undef STORE |
| 733 UNREACHABLE(); | 719 UNREACHABLE(); |
| 734 return nullptr; | 720 return nullptr; |
| 735 } | 721 } |
| 736 | 722 |
| 737 } // namespace compiler | 723 } // namespace compiler |
| 738 } // namespace internal | 724 } // namespace internal |
| 739 } // namespace v8 | 725 } // namespace v8 |
| OLD | NEW |