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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 typedef MachineType CheckedLoadRepresentation; | 86 typedef MachineType CheckedLoadRepresentation; |
87 | 87 |
88 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*); | 88 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*); |
89 | 89 |
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 class StackSlotRepresentation final { |
| 97 public: |
| 98 StackSlotRepresentation(int size, int alignment) |
| 99 : size_(size), alignment_(alignment) {} |
| 100 |
| 101 int size() const { return size_; } |
| 102 int alignment() const { return alignment_; } |
| 103 |
| 104 private: |
| 105 int size_; |
| 106 int alignment_; |
| 107 }; |
| 108 |
| 109 V8_EXPORT_PRIVATE bool operator==(StackSlotRepresentation, |
| 110 StackSlotRepresentation); |
| 111 bool operator!=(StackSlotRepresentation, StackSlotRepresentation); |
| 112 |
| 113 size_t hash_value(StackSlotRepresentation); |
| 114 |
| 115 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, |
| 116 StackSlotRepresentation); |
| 117 |
| 118 StackSlotRepresentation const& StackSlotRepresentationOf(Operator const* op); |
97 | 119 |
98 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op); | 120 MachineRepresentation AtomicStoreRepresentationOf(Operator const* op); |
99 | 121 |
100 MachineType AtomicOpRepresentationOf(Operator const* op); | 122 MachineType AtomicOpRepresentationOf(Operator const* op); |
101 | 123 |
102 // Interface for building machine-level operators. These operators are | 124 // Interface for building machine-level operators. These operators are |
103 // machine-level but machine-independent and thus define a language suitable | 125 // machine-level but machine-independent and thus define a language suitable |
104 // for generating code to run on architectures such as ia32, x64, arm, etc. | 126 // for generating code to run on architectures such as ia32, x64, arm, etc. |
105 class V8_EXPORT_PRIVATE MachineOperatorBuilder final | 127 class V8_EXPORT_PRIVATE MachineOperatorBuilder final |
106 : public NON_EXPORTED_BASE(ZoneObject) { | 128 : public NON_EXPORTED_BASE(ZoneObject) { |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // store [base + index], value | 637 // store [base + index], value |
616 const Operator* Store(StoreRepresentation rep); | 638 const Operator* Store(StoreRepresentation rep); |
617 const Operator* ProtectedStore(MachineRepresentation rep); | 639 const Operator* ProtectedStore(MachineRepresentation rep); |
618 | 640 |
619 // unaligned load [base + index] | 641 // unaligned load [base + index] |
620 const Operator* UnalignedLoad(UnalignedLoadRepresentation rep); | 642 const Operator* UnalignedLoad(UnalignedLoadRepresentation rep); |
621 | 643 |
622 // unaligned store [base + index], value | 644 // unaligned store [base + index], value |
623 const Operator* UnalignedStore(UnalignedStoreRepresentation rep); | 645 const Operator* UnalignedStore(UnalignedStoreRepresentation rep); |
624 | 646 |
625 const Operator* StackSlot(int size); | 647 const Operator* StackSlot(int size, int alignment = 0); |
626 const Operator* StackSlot(MachineRepresentation rep); | 648 const Operator* StackSlot(MachineRepresentation rep, int alignment = 0); |
627 | 649 |
628 // Access to the machine stack. | 650 // Access to the machine stack. |
629 const Operator* LoadStackPointer(); | 651 const Operator* LoadStackPointer(); |
630 const Operator* LoadFramePointer(); | 652 const Operator* LoadFramePointer(); |
631 const Operator* LoadParentFramePointer(); | 653 const Operator* LoadParentFramePointer(); |
632 | 654 |
633 // checked-load heap, index, length | 655 // checked-load heap, index, length |
634 const Operator* CheckedLoad(CheckedLoadRepresentation); | 656 const Operator* CheckedLoad(CheckedLoadRepresentation); |
635 // checked-store heap, index, length, value | 657 // checked-store heap, index, length, value |
636 const Operator* CheckedStore(CheckedStoreRepresentation); | 658 const Operator* CheckedStore(CheckedStoreRepresentation); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 }; | 734 }; |
713 | 735 |
714 | 736 |
715 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 737 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
716 | 738 |
717 } // namespace compiler | 739 } // namespace compiler |
718 } // namespace internal | 740 } // namespace internal |
719 } // namespace v8 | 741 } // namespace v8 |
720 | 742 |
721 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 743 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |