Bug 1524337: Move WebAssembly reftypes/gc configuration to moz.configure; r=luke

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

--HG--
extra : rebase_source : 35112254e9eb5f239650466cc73329ccc175af4a
extra : histedit_source : 5a1a1d6b663c46b9cb63998566e8f101cf19eb46
This commit is contained in:
Benjamin Bouvier 2019-02-14 12:59:38 +01:00
parent 638a7c7e06
commit afec75505d
5 changed files with 65 additions and 25 deletions

View File

@ -98,7 +98,3 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ENABLE_WASM_REFTYPES'] = True
DEFINES['ENABLE_WASM_GC'] = True

View File

@ -538,3 +538,68 @@ js_option('--enable-wasm-bulk-memory',
set_config('ENABLE_WASM_BULKMEM_OPS', depends_if('--enable-wasm-bulk-memory')(lambda x: True))
set_define('ENABLE_WASM_BULKMEM_OPS', depends_if('--enable-wasm-bulk-memory')(lambda x: True))
# Support for WebAssembly reference types.
# =====================================================
@depends(milestone.is_nightly)
def default_wasm_reftypes(is_nightly):
return is_nightly
js_option('--enable-wasm-reftypes',
default=default_wasm_reftypes,
help='{Enable|Disable} WebAssembly reference types')
set_config('ENABLE_WASM_REFTYPES', depends_if('--enable-wasm-reftypes')(lambda x: True))
set_define('ENABLE_WASM_REFTYPES', depends_if('--enable-wasm-reftypes')(lambda x: True))
# Support for WebAssembly generalized tables (anyref tables, multiple tables).
# ============================================================================
@depends(milestone.is_nightly, '--enable-wasm-reftypes')
def default_wasm_generalized_tables(is_nightly, reftypes):
if reftypes and is_nightly:
return True
js_option('--enable-wasm-generalized-tables',
default=default_wasm_generalized_tables,
help='{Enable|Disable} WebAssembly generalized reference tables')
set_config('ENABLE_WASM_GENERALIZED_TABLES', depends_if('--enable-wasm-generalized-tables')(lambda x: True))
set_define('ENABLE_WASM_GENERALIZED_TABLES', depends_if('--enable-wasm-generalized-tables')(lambda x: True))
# Support for WebAssembly GC.
# ===========================
@depends(milestone.is_nightly, '--enable-wasm-reftypes')
def default_wasm_gc(is_nightly, reftypes):
if reftypes and is_nightly:
return True
js_option('--enable-wasm-gc',
default=default_wasm_gc,
help='{Enable|Disable} WebAssembly GC')
set_config('ENABLE_WASM_GC', depends_if('--enable-wasm-gc')(lambda x: True))
set_define('ENABLE_WASM_GC', depends_if('--enable-wasm-gc')(lambda x: True))
# Support for WebAssembly private ref types.
# Prevent (ref T) types from being exposed to JS content so that wasm need do
# no typechecking at the JS/wasm boundary
# ===========================================================================
@depends(milestone.is_nightly, '--enable-wasm-gc')
def default_wasm_private_reftypes(is_nightly, gc):
if gc and is_nightly:
return True
js_option('--enable-wasm-private-reftypes',
default=default_wasm_private_reftypes,
help='{Enable|Disable} WebAssembly private reference types')
set_config('WASM_PRIVATE_REFTYPES', depends_if('--enable-wasm-private-reftypes')(lambda x: True))
set_define('WASM_PRIVATE_REFTYPES', depends_if('--enable-wasm-private-reftypes')(lambda x: True))

View File

@ -4,19 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Nightly-only features
if CONFIG['NIGHTLY_BUILD']:
# Support the evolving reftypes proposal - anyref, funcref, null,
# and a few other things
DEFINES['ENABLE_WASM_REFTYPES'] = True
# Support table of anyref, multiple tables - requires reftypes
DEFINES['ENABLE_WASM_GENERALIZED_TABLES'] = True
# Support the evolving gc types proposal (struct types, etc)
DEFINES['ENABLE_WASM_GC'] = True
# Prevent (ref T) types from being exposed to JS content so that
# wasm need do no typechecking at the JS/wasm boundary
DEFINES['WASM_PRIVATE_REFTYPES'] = True
# Some huge-mapping optimization instead of bounds checks on supported
# platforms.
if CONFIG['JS_CODEGEN_X64'] or CONFIG['JS_CODEGEN_ARM64']:

View File

@ -66,7 +66,3 @@ LOCAL_INCLUDES += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-shadow', '-Werror=format']
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ENABLE_WASM_REFTYPES'] = True
DEFINES['ENABLE_WASM_GC'] = True

View File

@ -45,10 +45,6 @@ DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
if CONFIG['MOZ_ENABLE_WEBRENDER']:
DEFINES['MOZ_ENABLE_WEBRENDER'] = True
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ENABLE_WASM_REFTYPES'] = True
DEFINES['ENABLE_WASM_GC'] = True
if CONFIG['MOZ_BUILD_APP'] == 'browser':
DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True