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 1891033002: [Atomics] Remove Atomics code stubs; use TF ops (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove s390 code stub 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 6a506d26ad334c493ec8c92184eb1bf28b12d0cd..f957902bc51c8ac0184836e72dc43f2a16430e0d 100644
--- a/src/compiler/machine-operator.cc
+++ b/src/compiler/machine-operator.cc
@@ -69,7 +69,8 @@ std::ostream& operator<<(std::ostream& os, StoreRepresentation rep) {
LoadRepresentation LoadRepresentationOf(Operator const* op) {
- DCHECK_EQ(IrOpcode::kLoad, op->opcode());
+ DCHECK(IrOpcode::kLoad == op->opcode() ||
+ IrOpcode::kAtomicLoad == op->opcode());
return OpParameter<LoadRepresentation>(op);
}
@@ -250,6 +251,14 @@ MachineRepresentation StackSlotRepresentationOf(Operator const* op) {
V(kWord64) \
V(kTagged)
+#define ATOMIC_TYPE_LIST(V) \
+ V(Int8) \
+ V(Uint8) \
+ V(Int16) \
+ V(Uint16) \
+ V(Int32) \
+ V(Uint32)
+
struct MachineOperatorGlobalCache {
#define PURE(Name, properties, value_input_count, control_input_count, \
output_count) \
@@ -353,6 +362,18 @@ struct MachineOperatorGlobalCache {
CheckedStore##Type##Operator kCheckedStore##Type;
MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
+
+#define ATOMIC(Type) \
+ struct AtomicLoad##Type##Operator final \
+ : public Operator1<LoadRepresentation> { \
+ AtomicLoad##Type##Operator() \
+ : Operator1<LoadRepresentation>( \
+ IrOpcode::kAtomicLoad, Operator::kNoThrow | Operator::kNoWrite, \
+ "AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \
+ }; \
+ AtomicLoad##Type##Operator kAtomicLoad##Type;
+ ATOMIC_TYPE_LIST(ATOMIC)
+#undef ATOMIC
};
@@ -487,6 +508,18 @@ const Operator* MachineOperatorBuilder::Word64PopcntPlaceholder() {
const Operator* MachineOperatorBuilder::Word64CtzPlaceholder() {
return &cache_.kWord64Ctz;
}
+
+const Operator* MachineOperatorBuilder::AtomicLoad(LoadRepresentation rep) {
+#define LOAD(Type) \
+ if (rep == MachineType::Type()) { \
+ return &cache_.kAtomicLoad##Type; \
+ }
+ ATOMIC_TYPE_LIST(LOAD)
+#undef LOAD
+ 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