Bug 1623889 - Allow SAB to be disabled in js shell. r=bbouvier

The previous fix here was a hack that would disable SAB in the JS
shell on non-nightly, but this breaks various tests that no longer
guard properly for SAB.  Instead of embedding the hack more deeply by
changing those tests, we fix it the way it should have been from the
outset: SAB is enabled in the shell on all channels but can be
disabled by a switch.

Differential Revision: https://phabricator.services.mozilla.com/D68515

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Lars T Hansen 2020-03-27 16:56:25 +00:00
Родитель 9b727b1e0b
Коммит 7b4366d9af
2 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -616,17 +616,15 @@ set_define('ENABLE_WASM_MULTI_VALUE', depends_if('--enable-wasm-multi-value')(la
# and atomics it can go away.
# =====================================================
@depends(milestone.is_nightly)
def default_wasm_threads(is_nightly):
return is_nightly
js_option('--disable-shared-memory', help='Disable JS/WebAssembly shared memory and atomics')
js_option('--enable-wasm-threads',
default=default_wasm_threads,
help='{Enable|Disable} WebAssembly shared memory and atomics')
set_config('ENABLE_WASM_THREADS', depends_if('--enable-wasm-threads')(lambda x: True))
set_define('ENABLE_WASM_THREADS', depends_if('--enable-wasm-threads')(lambda x: True))
@depends('--disable-shared-memory')
def enable_shared_memory(value):
if value:
return True
set_config('ENABLE_SHARED_MEMORY', enable_shared_memory)
set_define('ENABLE_SHARED_MEMORY', enable_shared_memory)
# Initial support for new regexp engine

Просмотреть файл

@ -208,7 +208,7 @@ static const size_t gMaxStackSize = 128 * sizeof(size_t) * 1024;
static const double MAX_TIMEOUT_SECONDS = 1800.0;
// Not necessarily in sync with the browser
#ifdef ENABLE_WASM_THREADS
#ifdef ENABLE_SHARED_MEMORY
# define SHARED_MEMORY_DEFAULT 1
#else
# define SHARED_MEMORY_DEFAULT 0