| 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 MachineRepresentation StackSlotRepresentationOf(Operator const* op); | 96 MachineRepresentation StackSlotRepresentationOf(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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 630 |
| 629 // checked-load heap, index, length | 631 // checked-load heap, index, length |
| 630 const Operator* CheckedLoad(CheckedLoadRepresentation); | 632 const Operator* CheckedLoad(CheckedLoadRepresentation); |
| 631 // checked-store heap, index, length, value | 633 // checked-store heap, index, length, value |
| 632 const Operator* CheckedStore(CheckedStoreRepresentation); | 634 const Operator* CheckedStore(CheckedStoreRepresentation); |
| 633 | 635 |
| 634 // atomic-load [base + index] | 636 // atomic-load [base + index] |
| 635 const Operator* AtomicLoad(LoadRepresentation rep); | 637 const Operator* AtomicLoad(LoadRepresentation rep); |
| 636 // atomic-store [base + index], value | 638 // atomic-store [base + index], value |
| 637 const Operator* AtomicStore(MachineRepresentation rep); | 639 const Operator* AtomicStore(MachineRepresentation rep); |
| 640 // atomic-exchange [base + index], value |
| 641 const Operator* AtomicExchange(MachineType rep); |
| 638 | 642 |
| 639 // Target machine word-size assumed by this builder. | 643 // Target machine word-size assumed by this builder. |
| 640 bool Is32() const { return word() == MachineRepresentation::kWord32; } | 644 bool Is32() const { return word() == MachineRepresentation::kWord32; } |
| 641 bool Is64() const { return word() == MachineRepresentation::kWord64; } | 645 bool Is64() const { return word() == MachineRepresentation::kWord64; } |
| 642 MachineRepresentation word() const { return word_; } | 646 MachineRepresentation word() const { return word_; } |
| 643 | 647 |
| 644 bool UnalignedLoadSupported(const MachineType& machineType, | 648 bool UnalignedLoadSupported(const MachineType& machineType, |
| 645 uint8_t alignment) { | 649 uint8_t alignment) { |
| 646 return alignment_requirements_.IsUnalignedLoadSupported(machineType, | 650 return alignment_requirements_.IsUnalignedLoadSupported(machineType, |
| 647 alignment); | 651 alignment); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 }; | 698 }; |
| 695 | 699 |
| 696 | 700 |
| 697 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 701 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
| 698 | 702 |
| 699 } // namespace compiler | 703 } // namespace compiler |
| 700 } // namespace internal | 704 } // namespace internal |
| 701 } // namespace v8 | 705 } // namespace v8 |
| 702 | 706 |
| 703 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 707 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
| OLD | NEW |