| Index: src/compiler/machine-operator.cc
|
| diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc
|
| index 04f75ef5386f27669653b36a34294ce0ad1069f1..b2968feab3379f367b8ee96181cca1b27c7aa29e 100644
|
| --- a/src/compiler/machine-operator.cc
|
| +++ b/src/compiler/machine-operator.cc
|
| @@ -79,6 +79,11 @@ MachineRepresentation StackSlotRepresentationOf(Operator const* op) {
|
| return OpParameter<MachineRepresentation>(op);
|
| }
|
|
|
| +MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
|
| + DCHECK_EQ(IrOpcode::kAtomicStore, op->opcode());
|
| + return OpParameter<MachineRepresentation>(op);
|
| +}
|
| +
|
| #define PURE_OP_LIST(V) \
|
| V(Word32And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
|
| V(Word32Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
|
| @@ -416,6 +421,11 @@ MachineRepresentation StackSlotRepresentationOf(Operator const* op) {
|
| V(Int32) \
|
| V(Uint32)
|
|
|
| +#define ATOMIC_REPRESENTATION_LIST(V) \
|
| + V(kWord8) \
|
| + V(kWord16) \
|
| + V(kWord32)
|
| +
|
| struct MachineOperatorGlobalCache {
|
| #define PURE(Name, properties, value_input_count, control_input_count, \
|
| output_count) \
|
| @@ -507,7 +517,7 @@ struct MachineOperatorGlobalCache {
|
| MACHINE_REPRESENTATION_LIST(STORE)
|
| #undef STORE
|
|
|
| -#define ATOMIC(Type) \
|
| +#define ATOMIC_LOAD(Type) \
|
| struct AtomicLoad##Type##Operator final \
|
| : public Operator1<LoadRepresentation> { \
|
| AtomicLoad##Type##Operator() \
|
| @@ -516,8 +526,20 @@ struct MachineOperatorGlobalCache {
|
| "AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \
|
| }; \
|
| AtomicLoad##Type##Operator kAtomicLoad##Type;
|
| - ATOMIC_TYPE_LIST(ATOMIC)
|
| -#undef ATOMIC
|
| + ATOMIC_TYPE_LIST(ATOMIC_LOAD)
|
| +#undef ATOMIC_LOAD
|
| +
|
| +#define ATOMIC_STORE(Type) \
|
| + struct AtomicStore##Type##Operator \
|
| + : public Operator1<MachineRepresentation> { \
|
| + AtomicStore##Type##Operator() \
|
| + : Operator1<MachineRepresentation>( \
|
| + IrOpcode::kAtomicStore, Operator::kNoRead | Operator::kNoThrow, \
|
| + "AtomicStore", 3, 1, 1, 0, 1, 0, MachineRepresentation::Type) {} \
|
| + }; \
|
| + AtomicStore##Type##Operator kAtomicStore##Type;
|
| + ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE)
|
| +#undef STORE
|
| };
|
|
|
|
|
| @@ -651,6 +673,17 @@ const Operator* MachineOperatorBuilder::AtomicLoad(LoadRepresentation rep) {
|
| return nullptr;
|
| }
|
|
|
| +const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) {
|
| +#define STORE(kRep) \
|
| + if (rep == MachineRepresentation::kRep) { \
|
| + return &cache_.kAtomicStore##kRep; \
|
| + }
|
| + ATOMIC_REPRESENTATION_LIST(STORE)
|
| +#undef STORE
|
| + UNREACHABLE();
|
| + return nullptr;
|
| +}
|
| +
|
| } // namespace compiler
|
| } // namespace internal
|
| } // namespace v8
|
|
|