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

Unified Diff: src/futex-emulation.cc

Issue 2143443002: [Atomics] Rename Atomics.futex*, remove Atomics.futexWakeOrRequeue (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master Created 4 years, 5 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/futex-emulation.h ('k') | src/heap-symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/futex-emulation.cc
diff --git a/src/futex-emulation.cc b/src/futex-emulation.cc
index 1f7e8a6d73984a121dcf3eff35d954244311c513..57894f14d389b5517a039ac017d9a428a9cc3bd6 100644
--- a/src/futex-emulation.cc
+++ b/src/futex-emulation.cc
@@ -84,7 +84,7 @@ Object* FutexEmulation::Wait(Isolate* isolate,
base::LockGuard<base::Mutex> lock_guard(mutex_.Pointer());
if (*p != value) {
- return Smi::FromInt(Result::kNotEqual);
+ return isolate->heap()->not_equal();
}
FutexWaitListNode* node = isolate->futex_wait_list_node();
@@ -157,7 +157,7 @@ Object* FutexEmulation::Wait(Isolate* isolate,
}
if (!node->waiting_) {
- result = Smi::FromInt(Result::kOk);
+ result = isolate->heap()->ok();
break;
}
@@ -165,7 +165,7 @@ Object* FutexEmulation::Wait(Isolate* isolate,
if (use_timeout) {
current_time = base::TimeTicks::Now();
if (current_time >= timeout_time) {
- result = Smi::FromInt(Result::kTimedOut);
+ result = isolate->heap()->timed_out();
break;
}
@@ -213,44 +213,6 @@ Object* FutexEmulation::Wake(Isolate* isolate,
}
-Object* FutexEmulation::WakeOrRequeue(Isolate* isolate,
- Handle<JSArrayBuffer> array_buffer,
- size_t addr, int num_waiters_to_wake,
- int32_t value, size_t addr2) {
- DCHECK(addr < NumberToSize(isolate, array_buffer->byte_length()));
- DCHECK(addr2 < NumberToSize(isolate, array_buffer->byte_length()));
-
- void* backing_store = array_buffer->backing_store();
- int32_t* p =
- reinterpret_cast<int32_t*>(static_cast<int8_t*>(backing_store) + addr);
-
- base::LockGuard<base::Mutex> lock_guard(mutex_.Pointer());
- if (*p != value) {
- return Smi::FromInt(Result::kNotEqual);
- }
-
- // Wake |num_waiters_to_wake|
- int waiters_woken = 0;
- FutexWaitListNode* node = wait_list_.Pointer()->head_;
- while (node) {
- if (backing_store == node->backing_store_ && addr == node->wait_addr_) {
- if (num_waiters_to_wake > 0) {
- node->waiting_ = false;
- node->cond_.NotifyOne();
- --num_waiters_to_wake;
- waiters_woken++;
- } else {
- node->wait_addr_ = addr2;
- }
- }
-
- node = node->next_;
- }
-
- return Smi::FromInt(waiters_woken);
-}
-
-
Object* FutexEmulation::NumWaitersForTesting(Isolate* isolate,
Handle<JSArrayBuffer> array_buffer,
size_t addr) {
« no previous file with comments | « src/futex-emulation.h ('k') | src/heap-symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698