Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Side by Side Diff: src/compiler/machine-operator.h

Issue 2816743003: [turbofan] Add alignment parameter to StackSlot operator (Closed)
Patch Set: Upload missing file Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 // store [base + index], value 619 // store [base + index], value
598 const Operator* Store(StoreRepresentation rep); 620 const Operator* Store(StoreRepresentation rep);
599 const Operator* ProtectedStore(MachineRepresentation rep); 621 const Operator* ProtectedStore(MachineRepresentation rep);
600 622
601 // unaligned load [base + index] 623 // unaligned load [base + index]
602 const Operator* UnalignedLoad(UnalignedLoadRepresentation rep); 624 const Operator* UnalignedLoad(UnalignedLoadRepresentation rep);
603 625
604 // unaligned store [base + index], value 626 // unaligned store [base + index], value
605 const Operator* UnalignedStore(UnalignedStoreRepresentation rep); 627 const Operator* UnalignedStore(UnalignedStoreRepresentation rep);
606 628
607 const Operator* StackSlot(int size); 629 const Operator* StackSlot(int size, int alignment = 0);
608 const Operator* StackSlot(MachineRepresentation rep); 630 const Operator* StackSlot(MachineRepresentation rep, int alignment = 0);
609 631
610 // Access to the machine stack. 632 // Access to the machine stack.
611 const Operator* LoadStackPointer(); 633 const Operator* LoadStackPointer();
612 const Operator* LoadFramePointer(); 634 const Operator* LoadFramePointer();
613 const Operator* LoadParentFramePointer(); 635 const Operator* LoadParentFramePointer();
614 636
615 // checked-load heap, index, length 637 // checked-load heap, index, length
616 const Operator* CheckedLoad(CheckedLoadRepresentation); 638 const Operator* CheckedLoad(CheckedLoadRepresentation);
617 // checked-store heap, index, length, value 639 // checked-store heap, index, length, value
618 const Operator* CheckedStore(CheckedStoreRepresentation); 640 const Operator* CheckedStore(CheckedStoreRepresentation);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 }; 716 };
695 717
696 718
697 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 719 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
698 720
699 } // namespace compiler 721 } // namespace compiler
700 } // namespace internal 722 } // namespace internal
701 } // namespace v8 723 } // namespace v8
702 724
703 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 725 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698