| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 607 |
| 606 // checked-load heap, index, length | 608 // checked-load heap, index, length |
| 607 const Operator* CheckedLoad(CheckedLoadRepresentation); | 609 const Operator* CheckedLoad(CheckedLoadRepresentation); |
| 608 // checked-store heap, index, length, value | 610 // checked-store heap, index, length, value |
| 609 const Operator* CheckedStore(CheckedStoreRepresentation); | 611 const Operator* CheckedStore(CheckedStoreRepresentation); |
| 610 | 612 |
| 611 // atomic-load [base + index] | 613 // atomic-load [base + index] |
| 612 const Operator* AtomicLoad(LoadRepresentation rep); | 614 const Operator* AtomicLoad(LoadRepresentation rep); |
| 613 // atomic-store [base + index], value | 615 // atomic-store [base + index], value |
| 614 const Operator* AtomicStore(MachineRepresentation rep); | 616 const Operator* AtomicStore(MachineRepresentation rep); |
| 617 // atomic-exchange [base + index], value |
| 618 const Operator* AtomicExchange(MachineType rep); |
| 615 | 619 |
| 616 // Target machine word-size assumed by this builder. | 620 // Target machine word-size assumed by this builder. |
| 617 bool Is32() const { return word() == MachineRepresentation::kWord32; } | 621 bool Is32() const { return word() == MachineRepresentation::kWord32; } |
| 618 bool Is64() const { return word() == MachineRepresentation::kWord64; } | 622 bool Is64() const { return word() == MachineRepresentation::kWord64; } |
| 619 MachineRepresentation word() const { return word_; } | 623 MachineRepresentation word() const { return word_; } |
| 620 | 624 |
| 621 bool UnalignedLoadSupported(const MachineType& machineType, | 625 bool UnalignedLoadSupported(const MachineType& machineType, |
| 622 uint8_t alignment) { | 626 uint8_t alignment) { |
| 623 return alignment_requirements_.IsUnalignedLoadSupported(machineType, | 627 return alignment_requirements_.IsUnalignedLoadSupported(machineType, |
| 624 alignment); | 628 alignment); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 }; | 675 }; |
| 672 | 676 |
| 673 | 677 |
| 674 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 678 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
| 675 | 679 |
| 676 } // namespace compiler | 680 } // namespace compiler |
| 677 } // namespace internal | 681 } // namespace internal |
| 678 } // namespace v8 | 682 } // namespace v8 |
| 679 | 683 |
| 680 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 684 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
| OLD | NEW |