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

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

Issue 2874713003: [turbofan] Reland of `Add alignment parameter to StackSlot operator` (Closed)
Patch Set: Fix failures with control flow integrity bots Created 3 years, 7 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
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 // store [base + index], value 614 // store [base + index], value
593 const Operator* Store(StoreRepresentation rep); 615 const Operator* Store(StoreRepresentation rep);
594 const Operator* ProtectedStore(MachineRepresentation rep); 616 const Operator* ProtectedStore(MachineRepresentation rep);
595 617
596 // unaligned load [base + index] 618 // unaligned load [base + index]
597 const Operator* UnalignedLoad(UnalignedLoadRepresentation rep); 619 const Operator* UnalignedLoad(UnalignedLoadRepresentation rep);
598 620
599 // unaligned store [base + index], value 621 // unaligned store [base + index], value
600 const Operator* UnalignedStore(UnalignedStoreRepresentation rep); 622 const Operator* UnalignedStore(UnalignedStoreRepresentation rep);
601 623
602 const Operator* StackSlot(int size); 624 const Operator* StackSlot(int size, int alignment = 0);
603 const Operator* StackSlot(MachineRepresentation rep); 625 const Operator* StackSlot(MachineRepresentation rep, int alignment = 0);
604 626
605 // Access to the machine stack. 627 // Access to the machine stack.
606 const Operator* LoadStackPointer(); 628 const Operator* LoadStackPointer();
607 const Operator* LoadFramePointer(); 629 const Operator* LoadFramePointer();
608 const Operator* LoadParentFramePointer(); 630 const Operator* LoadParentFramePointer();
609 631
610 // checked-load heap, index, length 632 // checked-load heap, index, length
611 const Operator* CheckedLoad(CheckedLoadRepresentation); 633 const Operator* CheckedLoad(CheckedLoadRepresentation);
612 // checked-store heap, index, length, value 634 // checked-store heap, index, length, value
613 const Operator* CheckedStore(CheckedStoreRepresentation); 635 const Operator* CheckedStore(CheckedStoreRepresentation);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 }; 711 };
690 712
691 713
692 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 714 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
693 715
694 } // namespace compiler 716 } // namespace compiler
695 } // namespace internal 717 } // namespace internal
696 } // namespace v8 718 } // namespace v8
697 719
698 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 720 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698