Commit aa50e53b authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[Atomics.waitAsync] Separate node lists per location

The design included per-location lists, but they were left out in
Version 1 of the implementation.

In addition: drive-by style unification.

Bug: v8:10239
Change-Id: Ia4d69fdf4ce0c3aad2dae8082e00e9fa14c4170a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339620
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69319}
parent 1a9c676a
This diff is collapsed.
...@@ -100,6 +100,17 @@ class FutexWaitListNode { ...@@ -100,6 +100,17 @@ class FutexWaitListNode {
std::weak_ptr<BackingStore> backing_store_; std::weak_ptr<BackingStore> backing_store_;
size_t wait_addr_ = 0; size_t wait_addr_ = 0;
// The memory location the FutexWaitListNode is waiting on. Equals
// backing_store_->buffer_start() + wait_addr_ at FutexWaitListNode creation
// time. Storing the wait_location_ separately is needed, since we can't
// necessarily reconstruct it, because the BackingStore might get deleted
// while the FutexWaitListNode is still alive. FutexWaitListNode must know its
// wait location, since they are stored in per-location lists, and to remove
// the node, we need to be able to find the list it's on (to be able to
// update the head and tail of the list).
int8_t* wait_location_ = nullptr;
// waiting_ and interrupted_ are protected by FutexEmulation::mutex_ // waiting_ and interrupted_ are protected by FutexEmulation::mutex_
// if this node is currently contained in FutexEmulation::wait_list_ // if this node is currently contained in FutexEmulation::wait_list_
// or an AtomicsWaitWakeHandle has access to it. // or an AtomicsWaitWakeHandle has access to it.
...@@ -224,9 +235,6 @@ class FutexEmulation : public AllStatic { ...@@ -224,9 +235,6 @@ class FutexEmulation : public AllStatic {
// Remove the node's Promise from the NativeContext's Promise set. // Remove the node's Promise from the NativeContext's Promise set.
static void CleanupAsyncWaiterPromise(FutexWaitListNode* node); static void CleanupAsyncWaiterPromise(FutexWaitListNode* node);
// Deletes |node| and returns the next node of its list.
static FutexWaitListNode* DeleteAsyncWaiterNode(FutexWaitListNode* node);
}; };
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
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