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

Unified Diff: src/runtime/runtime-futex.cc

Issue 1462833002: Support offset-TypedArray in futex API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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.cc ('k') | test/mjsunit/harmony/futex.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-futex.cc
diff --git a/src/runtime/runtime-futex.cc b/src/runtime/runtime-futex.cc
index b2bad77c981e12b20c8126f7b983039eb1bd5f45..f4ef679bf6ad01d42e725e736797450c5ea45da7 100644
--- a/src/runtime/runtime-futex.cc
+++ b/src/runtime/runtime-futex.cc
@@ -30,7 +30,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWait) {
RUNTIME_ASSERT(timeout == V8_INFINITY || !std::isnan(timeout));
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
- size_t addr = index << 2;
+ size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset());
return FutexEmulation::Wait(isolate, array_buffer, addr, value, timeout);
}
@@ -47,7 +47,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWake) {
RUNTIME_ASSERT(sta->type() == kExternalInt32Array);
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
- size_t addr = index << 2;
+ size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset());
return FutexEmulation::Wake(isolate, array_buffer, addr, count);
}
@@ -67,8 +67,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWakeOrRequeue) {
RUNTIME_ASSERT(sta->type() == kExternalInt32Array);
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
- size_t addr1 = index1 << 2;
- size_t addr2 = index2 << 2;
+ size_t addr1 = (index1 << 2) + NumberToSize(isolate, sta->byte_offset());
+ size_t addr2 = (index2 << 2) + NumberToSize(isolate, sta->byte_offset());
return FutexEmulation::WakeOrRequeue(isolate, array_buffer, addr1, count,
value, addr2);
@@ -85,7 +85,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexNumWaitersForTesting) {
RUNTIME_ASSERT(sta->type() == kExternalInt32Array);
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
- size_t addr = index << 2;
+ size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset());
return FutexEmulation::NumWaitersForTesting(isolate, array_buffer, addr);
}
« no previous file with comments | « src/futex-emulation.cc ('k') | test/mjsunit/harmony/futex.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698