Bug 1527861: Allow disabling BinAST compilation; r=tcampbell
authorBenjamin Bouvier <benj@benj.me>
Thu, 14 Feb 2019 11:52:57 +0100
changeset 517417 2d4f87a0212e0a57e8ed39ebe9516a18b4e4ef3e
parent 517416 2d7295e1d7230c60a563aa66bce028d32cd2b29c
child 517418 259550ac3b5657a939450e5692d8cf46e4c53fc4
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1527861
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 1527861: Allow disabling BinAST compilation; r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D19765
js/moz.configure
js/src/frontend/moz.build
js/src/moz.build
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -470,23 +470,26 @@ def enable_pipeline_operator(value):
 set_config('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
 set_define('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
 
 
 
 # Experimental support for BinAST
 # ==============================================================
 
-@depends(milestone)
-def enable_build_binast(milestone):
-    if milestone.is_nightly:
-        return True
+@depends(milestone.is_nightly)
+def default_binast(is_nightly):
+    return is_nightly
 
-set_define('JS_BUILD_BINAST', enable_build_binast)
-set_config('JS_BUILD_BINAST', enable_build_binast)
+js_option('--enable-binast',
+          default=default_binast,
+          help="{Enable|Disable} BinAST support")
+
+set_config('JS_BUILD_BINAST', depends_if('--enable-binast')(lambda x: True))
+set_define('JS_BUILD_BINAST', depends_if('--enable-binast')(lambda x: True))
 
 
 # Experimental support for wasm code generation with Cranelift
 # ==============================================================
 
 @depends(milestone.is_nightly)
 def default_cranelift(is_nightly):
     return is_nightly
--- a/js/src/frontend/moz.build
+++ b/js/src/frontend/moz.build
@@ -71,16 +71,20 @@ if CONFIG['JS_BUILD_BINAST']:
         'BinASTParserBase.cpp',
         'BinASTParserPerTokenizer.cpp',
         'BinSourceRuntimeSupport.cpp',
         'BinToken.cpp',
         'BinTokenReaderBase.cpp',
         'BinTokenReaderMultipart.cpp',
     ]
 
+    DIRS += [
+        'binsource'
+    ]
+
     # Instrument BinAST files for fuzzing as we have a fuzzing target for BinAST.
     if CONFIG['FUZZING_INTERFACES'] and CONFIG['LIBFUZZER']:
         include('/tools/fuzzing/libfuzzer-flags.mozbuild')
 
         SOURCES['BinASTParser.cpp'].flags += libfuzzer_flags
         SOURCES['BinASTParserBase.cpp'].flags += libfuzzer_flags
         SOURCES['BinASTParserPerTokenizer.cpp'].flags += libfuzzer_flags
         SOURCES['BinToken.cpp'].flags += libfuzzer_flags
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -404,17 +404,16 @@ if CONFIG['HAVE_LINUX_PERF_EVENT_H']:
 else:
     SOURCES += [
         'perf/pm_stub.cpp'
     ]
 
 DIRS += [
     'build',
     'frontend',
-    'frontend/binsource',
     'gc',
     'jit',
     'wasm',
 ]
 
 FINAL_LIBRARY = 'js'
 
 # Prepare self-hosted JS code for embedding