Commit c2a7fac9 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[csa][cleanup] TNodify AtomicStore.

Splits the 64bit operation to a seperate function since there are
different return types depending upon whether the architecture is
64-bit or 32-bit.

BUG=v8:6949,v8:11074

Change-Id: If196cf658298ca0a1e5a13e1db812178307e7d12
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2531789
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71132}
parent efb5786a
......@@ -339,8 +339,7 @@ TF_BUILTIN(AtomicsStore, SharedArrayBufferBuiltinsAssembler) {
TVARIABLE(UintPtrT, var_high);
BigIntToRawBytes(value_bigint, &var_low, &var_high);
TNode<UintPtrT> high = Is64() ? TNode<UintPtrT>() : var_high.value();
AtomicStore(MachineRepresentation::kWord64, backing_store,
WordShl(index_word, 3), var_low.value(), high);
AtomicStore64(backing_store, WordShl(index_word, 3), var_low.value(), high);
Return(value_bigint);
#endif
......
......@@ -810,9 +810,15 @@ Node* CodeAssembler::StoreFullTaggedNoWriteBarrier(Node* base, Node* offset,
BitcastTaggedToWord(tagged_value));
}
Node* CodeAssembler::AtomicStore(MachineRepresentation rep, Node* base,
Node* offset, Node* value, Node* value_high) {
return raw_assembler()->AtomicStore(rep, base, offset, value, value_high);
void CodeAssembler::AtomicStore(MachineRepresentation rep, TNode<RawPtrT> base,
TNode<WordT> offset, TNode<Word32T> value) {
raw_assembler()->AtomicStore(rep, base, offset, value);
}
void CodeAssembler::AtomicStore64(TNode<RawPtrT> base, TNode<WordT> offset,
TNode<UintPtrT> value,
TNode<UintPtrT> value_high) {
raw_assembler()->AtomicStore64(base, offset, value, value_high);
}
#define ATOMIC_FUNCTION(name) \
......
......@@ -800,10 +800,12 @@ class V8_EXPORT_PRIVATE CodeAssembler {
TNode<HeapObject> object,
int offset, Node* value);
void OptimizedStoreMap(TNode<HeapObject> object, TNode<Map>);
void AtomicStore(MachineRepresentation rep, TNode<RawPtrT> base,
TNode<WordT> offset, TNode<Word32T> value);
// {value_high} is used for 64-bit stores on 32-bit platforms, must be
// nullptr in other cases.
Node* AtomicStore(MachineRepresentation rep, Node* base, Node* offset,
Node* value, Node* value_high = nullptr);
void AtomicStore64(TNode<RawPtrT> base, TNode<WordT> offset,
TNode<UintPtrT> value, TNode<UintPtrT> value_high);
TNode<Word32T> AtomicAdd(MachineType type, TNode<RawPtrT> base,
TNode<UintPtrT> offset, TNode<Word32T> value);
......
......@@ -244,19 +244,23 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
#endif
Node* AtomicStore(MachineRepresentation rep, Node* base, Node* index,
Node* value, Node* value_high) {
if (rep == MachineRepresentation::kWord64) {
if (machine()->Is64()) {
DCHECK_NULL(value_high);
return AddNode(machine()->Word64AtomicStore(rep), base, index, value);
} else {
return AddNode(machine()->Word32AtomicPairStore(), base, index,
VALUE_HALVES);
}
}
DCHECK_NULL(value_high);
Node* value) {
DCHECK_NE(rep, MachineRepresentation::kWord64);
return AddNode(machine()->Word32AtomicStore(rep), base, index, value);
}
Node* AtomicStore64(Node* base, Node* index, Node* value, Node* value_high) {
if (machine()->Is64()) {
DCHECK_NULL(value_high);
return AddNode(
machine()->Word64AtomicStore(MachineRepresentation::kWord64), base,
index, value);
} else {
return AddNode(machine()->Word32AtomicPairStore(), base, index,
VALUE_HALVES);
}
}
#define ATOMIC_FUNCTION(name) \
Node* Atomic##name(MachineType type, Node* base, Node* index, Node* value) { \
DCHECK_NE(type.representation(), MachineRepresentation::kWord64); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment