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) { |