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

Unified Diff: src/compiler/machine-operator.cc

Issue 2867403002: Revert of [turbofan] Add alignment parameter to StackSlot operator (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator.cc
diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc
index 96f7dc1a9100a7ab9def22ce3f31b91a5fc619ac..95761f4b12196e56758d3a6357fc456c54cd9fcb 100644
--- a/src/compiler/machine-operator.cc
+++ b/src/compiler/machine-operator.cc
@@ -70,25 +70,9 @@
return OpParameter<CheckedStoreRepresentation>(op);
}
-bool operator==(StackSlotRepresentation lhs, StackSlotRepresentation rhs) {
- return lhs.size() == rhs.size() && lhs.alignment() == rhs.alignment();
-}
-
-bool operator!=(StackSlotRepresentation lhs, StackSlotRepresentation rhs) {
- return !(lhs == rhs);
-}
-
-size_t hash_value(StackSlotRepresentation rep) {
- return base::hash_combine(rep.size(), rep.alignment());
-}
-
-std::ostream& operator<<(std::ostream& os, StackSlotRepresentation rep) {
- return os << "(" << rep.size() << " : " << rep.alignment() << ")";
-}
-
-StackSlotRepresentation const& StackSlotRepresentationOf(Operator const* op) {
+int StackSlotSizeOf(Operator const* op) {
DCHECK_EQ(IrOpcode::kStackSlot, op->opcode());
- return OpParameter<StackSlotRepresentation>(op);
+ return OpParameter<int>(op);
}
MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
@@ -439,15 +423,13 @@
V(16x8, 16) \
V(8x16, 8)
-#define STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(V) \
- V(4, 0) V(8, 0) V(16, 0) V(4, 4) V(8, 8) V(16, 16)
-
-struct StackSlotOperator : public Operator1<StackSlotRepresentation> {
- explicit StackSlotOperator(int size, int alignment)
- : Operator1<StackSlotRepresentation>(
- IrOpcode::kStackSlot, Operator::kNoDeopt | Operator::kNoThrow,
- "StackSlot", 0, 0, 0, 1, 0, 0,
- StackSlotRepresentation(size, alignment)) {}
+#define STACK_SLOT_CACHED_SIZES_LIST(V) V(4) V(8) V(16)
+
+struct StackSlotOperator : public Operator1<int> {
+ explicit StackSlotOperator(int size)
+ : Operator1<int>(IrOpcode::kStackSlot,
+ Operator::kNoDeopt | Operator::kNoThrow, "StackSlot", 0,
+ 0, 0, 1, 0, 0, size) {}
};
struct MachineOperatorGlobalCache {
@@ -514,15 +496,12 @@
MACHINE_TYPE_LIST(LOAD)
#undef LOAD
-#define STACKSLOT(Size, Alignment) \
- struct StackSlotOfSize##Size##OfAlignment##Alignment##Operator final \
- : public StackSlotOperator { \
- StackSlotOfSize##Size##OfAlignment##Alignment##Operator() \
- : StackSlotOperator(Size, Alignment) {} \
- }; \
- StackSlotOfSize##Size##OfAlignment##Alignment##Operator \
- kStackSlotOfSize##Size##OfAlignment##Alignment;
- STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(STACKSLOT)
+#define STACKSLOT(Size) \
+ struct StackSlotOfSize##Size##Operator final : public StackSlotOperator { \
+ StackSlotOfSize##Size##Operator() : StackSlotOperator(Size) {} \
+ }; \
+ StackSlotOfSize##Size##Operator kStackSlotSize##Size;
+ STACK_SLOT_CACHED_SIZES_LIST(STACKSLOT)
#undef STACKSLOT
#define STORE(Type) \
@@ -773,23 +752,21 @@
return nullptr;
}
-const Operator* MachineOperatorBuilder::StackSlot(int size, int alignment) {
+const Operator* MachineOperatorBuilder::StackSlot(int size) {
DCHECK_LE(0, size);
- DCHECK(alignment == 0 || alignment == 4 || alignment == 8 || alignment == 16);
-#define CASE_CACHED_SIZE(Size, Alignment) \
- if (size == Size && alignment == Alignment) { \
- return &cache_.kStackSlotOfSize##Size##OfAlignment##Alignment; \
- }
-
- STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(CASE_CACHED_SIZE)
-
+#define CASE_CACHED_SIZE(Size) \
+ case Size: \
+ return &cache_.kStackSlotSize##Size;
+ switch (size) {
+ STACK_SLOT_CACHED_SIZES_LIST(CASE_CACHED_SIZE);
+ default:
+ return new (zone_) StackSlotOperator(size);
+ }
#undef CASE_CACHED_SIZE
- return new (zone_) StackSlotOperator(size, alignment);
-}
-
-const Operator* MachineOperatorBuilder::StackSlot(MachineRepresentation rep,
- int alignment) {
- return StackSlot(1 << ElementSizeLog2Of(rep), alignment);
+}
+
+const Operator* MachineOperatorBuilder::StackSlot(MachineRepresentation rep) {
+ return StackSlot(1 << ElementSizeLog2Of(rep));
}
const Operator* MachineOperatorBuilder::Store(StoreRepresentation store_rep) {
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698