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

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

Issue 1938213002: [Atomics] Make Atomics.store a builtin using TF (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge again Created 4 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 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 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
« 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