OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ | 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ |
6 #define V8_COMPILER_MACHINE_OPERATOR_H_ | 6 #define V8_COMPILER_MACHINE_OPERATOR_H_ |
7 | 7 |
8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/flags.h" | 9 #include "src/base/flags.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // A CheckedStore needs a MachineType. | 91 // A CheckedStore needs a MachineType. |
92 typedef MachineRepresentation CheckedStoreRepresentation; | 92 typedef MachineRepresentation CheckedStoreRepresentation; |
93 | 93 |
94 CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const*); | 94 CheckedStoreRepresentation CheckedStoreRepresentationOf(Operator const*); |
95 | 95 |
96 int StackSlotSizeOf(Operator const* op); | 96 int StackSlotSizeOf(Operator const* op); |
97 | 97 |
98 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op); | 98 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op); |
99 | 99 |
100 MachineType AtomicExchangeRepresentationOf(Operator const* op); | 100 MachineType AtomicOpRepresentationOf(Operator const* op); |
101 | |
102 MachineType AtomicCompareExchangeRepresentationOf(Operator const* op); | |
103 | 101 |
104 // Interface for building machine-level operators. These operators are | 102 // Interface for building machine-level operators. These operators are |
105 // machine-level but machine-independent and thus define a language suitable | 103 // machine-level but machine-independent and thus define a language suitable |
106 // for generating code to run on architectures such as ia32, x64, arm, etc. | 104 // for generating code to run on architectures such as ia32, x64, arm, etc. |
107 class V8_EXPORT_PRIVATE MachineOperatorBuilder final | 105 class V8_EXPORT_PRIVATE MachineOperatorBuilder final |
108 : public NON_EXPORTED_BASE(ZoneObject) { | 106 : public NON_EXPORTED_BASE(ZoneObject) { |
109 public: | 107 public: |
110 // Flags that specify which operations are available. This is useful | 108 // Flags that specify which operations are available. This is useful |
111 // for operations that are unsupported by some back-ends. | 109 // for operations that are unsupported by some back-ends. |
112 enum Flag : unsigned { | 110 enum Flag : unsigned { |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 const Operator* CheckedStore(CheckedStoreRepresentation); | 606 const Operator* CheckedStore(CheckedStoreRepresentation); |
609 | 607 |
610 // atomic-load [base + index] | 608 // atomic-load [base + index] |
611 const Operator* AtomicLoad(LoadRepresentation rep); | 609 const Operator* AtomicLoad(LoadRepresentation rep); |
612 // atomic-store [base + index], value | 610 // atomic-store [base + index], value |
613 const Operator* AtomicStore(MachineRepresentation rep); | 611 const Operator* AtomicStore(MachineRepresentation rep); |
614 // atomic-exchange [base + index], value | 612 // atomic-exchange [base + index], value |
615 const Operator* AtomicExchange(MachineType rep); | 613 const Operator* AtomicExchange(MachineType rep); |
616 // atomic-compare-exchange [base + index], old_value, new_value | 614 // atomic-compare-exchange [base + index], old_value, new_value |
617 const Operator* AtomicCompareExchange(MachineType rep); | 615 const Operator* AtomicCompareExchange(MachineType rep); |
| 616 // atomic-add [base + index], value |
| 617 const Operator* AtomicAdd(MachineType rep); |
| 618 // atomic-sub [base + index], value |
| 619 const Operator* AtomicSub(MachineType rep); |
| 620 // atomic-and [base + index], value |
| 621 const Operator* AtomicAnd(MachineType rep); |
| 622 // atomic-or [base + index], value |
| 623 const Operator* AtomicOr(MachineType rep); |
| 624 // atomic-xor [base + index], value |
| 625 const Operator* AtomicXor(MachineType rep); |
618 | 626 |
619 // Target machine word-size assumed by this builder. | 627 // Target machine word-size assumed by this builder. |
620 bool Is32() const { return word() == MachineRepresentation::kWord32; } | 628 bool Is32() const { return word() == MachineRepresentation::kWord32; } |
621 bool Is64() const { return word() == MachineRepresentation::kWord64; } | 629 bool Is64() const { return word() == MachineRepresentation::kWord64; } |
622 MachineRepresentation word() const { return word_; } | 630 MachineRepresentation word() const { return word_; } |
623 | 631 |
624 bool UnalignedLoadSupported(const MachineType& machineType, | 632 bool UnalignedLoadSupported(const MachineType& machineType, |
625 uint8_t alignment) { | 633 uint8_t alignment) { |
626 return alignment_requirements_.IsUnalignedLoadSupported(machineType, | 634 return alignment_requirements_.IsUnalignedLoadSupported(machineType, |
627 alignment); | 635 alignment); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 }; | 682 }; |
675 | 683 |
676 | 684 |
677 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 685 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
678 | 686 |
679 } // namespace compiler | 687 } // namespace compiler |
680 } // namespace internal | 688 } // namespace internal |
681 } // namespace v8 | 689 } // namespace v8 |
682 | 690 |
683 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 691 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |