Bug 1524337: Move WebAssembly reftypes/gc configuration to moz.configure; r=luke
authorBenjamin Bouvier <benj@benj.me>
Thu, 14 Feb 2019 12:59:38 +0100
changeset 459534 2d7295e1d7230c60a563aa66bce028d32cd2b29c
parent 459533 4248681622989fb38ac10c07e9f9c82b32dc8f0c
child 459535 2d4f87a0212e0a57e8ed39ebe9516a18b4e4ef3e
push id35562
push usercsabou@mozilla.com
push dateFri, 15 Feb 2019 18:40:35 +0000
treeherdermozilla-central@8961019ee4c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1524337
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1524337: Move WebAssembly reftypes/gc configuration to moz.configure; r=luke Differential Revision: https://phabricator.services.mozilla.com/D19788
dom/workers/moz.build
js/moz.configure
js/src/js-config.mozbuild
js/xpconnect/src/moz.build
modules/libpref/moz.build
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -93,12 +93,8 @@ MOCHITEST_CHROME_MANIFESTS += [
 ]
 
 XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
 
 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
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -533,8 +533,73 @@ def default_wasm_bulk_memory(is_nightly)
     return is_nightly
 
 js_option('--enable-wasm-bulk-memory',
           default=default_wasm_bulk_memory,
           help='{Enable|Disable} WebAssembly bulk memory operators')
 
 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))
--- a/js/src/js-config.mozbuild
+++ b/js/src/js-config.mozbuild
@@ -1,27 +1,14 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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']:
     DEFINES['WASM_HUGE_MEMORY'] = True
 
 # Enables CACHEIR_LOGS to diagnose IC coverage, and
 # Structured spewer for diagnostics
 if CONFIG['MOZ_DEBUG'] or CONFIG['NIGHTLY_BUILD']:
--- a/js/xpconnect/src/moz.build
+++ b/js/xpconnect/src/moz.build
@@ -61,12 +61,8 @@ LOCAL_INCLUDES += [
     '/dom/html',
     '/dom/svg',
     '/layout/base',
     '/layout/style',
 ]
 
 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
--- a/modules/libpref/moz.build
+++ b/modules/libpref/moz.build
@@ -40,18 +40,14 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
 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
 
 FINAL_TARGET_PP_FILES += [
     'greprefs.js',
 ]