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); |
| 101 |
100 // Interface for building machine-level operators. These operators are | 102 // Interface for building machine-level operators. These operators are |
101 // machine-level but machine-independent and thus define a language suitable | 103 // machine-level but machine-independent and thus define a language suitable |
102 // 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. |
103 class V8_EXPORT_PRIVATE MachineOperatorBuilder final | 105 class V8_EXPORT_PRIVATE MachineOperatorBuilder final |
104 : public NON_EXPORTED_BASE(ZoneObject) { | 106 : public NON_EXPORTED_BASE(ZoneObject) { |
105 public: | 107 public: |
106 // Flags that specify which operations are available. This is useful | 108 // Flags that specify which operations are available. This is useful |
107 // for operations that are unsupported by some back-ends. | 109 // for operations that are unsupported by some back-ends. |
108 enum Flag : unsigned { | 110 enum Flag : unsigned { |
109 kNoFlags = 0u, | 111 kNoFlags = 0u, |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 614 |
613 // checked-load heap, index, length | 615 // checked-load heap, index, length |
614 const Operator* CheckedLoad(CheckedLoadRepresentation); | 616 const Operator* CheckedLoad(CheckedLoadRepresentation); |
615 // checked-store heap, index, length, value | 617 // checked-store heap, index, length, value |
616 const Operator* CheckedStore(CheckedStoreRepresentation); | 618 const Operator* CheckedStore(CheckedStoreRepresentation); |
617 | 619 |
618 // atomic-load [base + index] | 620 // atomic-load [base + index] |
619 const Operator* AtomicLoad(LoadRepresentation rep); | 621 const Operator* AtomicLoad(LoadRepresentation rep); |
620 // atomic-store [base + index], value | 622 // atomic-store [base + index], value |
621 const Operator* AtomicStore(MachineRepresentation rep); | 623 const Operator* AtomicStore(MachineRepresentation rep); |
| 624 // atomic-exchange [base + index], value |
| 625 const Operator* AtomicExchange(MachineType rep); |
622 | 626 |
623 // Target machine word-size assumed by this builder. | 627 // Target machine word-size assumed by this builder. |
624 bool Is32() const { return word() == MachineRepresentation::kWord32; } | 628 bool Is32() const { return word() == MachineRepresentation::kWord32; } |
625 bool Is64() const { return word() == MachineRepresentation::kWord64; } | 629 bool Is64() const { return word() == MachineRepresentation::kWord64; } |
626 MachineRepresentation word() const { return word_; } | 630 MachineRepresentation word() const { return word_; } |
627 | 631 |
628 bool UnalignedLoadSupported(const MachineType& machineType, | 632 bool UnalignedLoadSupported(const MachineType& machineType, |
629 uint8_t alignment) { | 633 uint8_t alignment) { |
630 return alignment_requirements_.IsUnalignedLoadSupported(machineType, | 634 return alignment_requirements_.IsUnalignedLoadSupported(machineType, |
631 alignment); | 635 alignment); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 }; | 682 }; |
679 | 683 |
680 | 684 |
681 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 685 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
682 | 686 |
683 } // namespace compiler | 687 } // namespace compiler |
684 } // namespace internal | 688 } // namespace internal |
685 } // namespace v8 | 689 } // namespace v8 |
686 | 690 |
687 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 691 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |