gecko-dev/js
Lars T Hansen 23854fd5a5 Bug 1566427 - Improved compiler availability computation. r=bbouvier
This patch cleans up wasm compiler selection and a few related things
with as few semantic changes as possible.  The intent is to centralize
compiler availability computation so that all parts of the system stay
in sync and it is easy to change compiler selection policy.

First, we introduce new predicates <Compiler>Available(cx) to test for
the actual availability of a compiler.  These predicates take into
account whether a compiler is compiled into the executable, whether it
supports the hardware, whether it is (currently) selected by
options/switches, and whether it can be used as a result of the
runtime environment (for example, Ion and Cranelift are not available
if the debugger is observing the page or if the GC feature is enabled;
Cranelift is not available if shared memory and atomics are enabled).
We switch to using these predicates almost everywhere that used
<Compiler>CanCompile() or cx->options().wasm<Compiler>(), since those
don't tell the full story.

Second, we implement a priority order of the optimizing compilers and
make it easy to change this order (see comments in code).  At the
moment, Cranelift is prioritized over Ion since Ion is enabled by
default and Cranelift is not; thus the desire of somebody flipping the
pref for Cranelift is to deselect Ion.  The priority order may change
in the future or may become platform-dependent.  The default compiler
selection in both browser and shell remains Baseline+Ion.

Third, we rename HasCompilerSupport() as HasPlatformSupport(), since
the predicate does not test whether compilers are available, only
whether they are present in the executable and support the hardware.
And to make that more sensible, <Compiler>CanCompile() is renamed
as <Compiler>PlatformSupport().

Fourth, we remove some redundant testing predicates (we don't need
both wasmDebugSupport and wasmDebuggingIsSupported, nor do we need
wasmUsesCranelift because wasmCompileMode is more reliable).

Fifth, we introduce a few new test cases that try to ensure that
compiler selection works as it should.  These are white-box and may
need to change if the compiler priority order changes.

Sixth, we rename the internal wasm::Has<Feature>Support() predicates
as wasm::<Feature>Available(), since they all actually test for
compiler availability.

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

--HG--
extra : moz-landing-system : lando
2020-03-11 07:53:03 +00:00
..
ductwork/debugger Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown 2020-02-27 17:39:15 +00:00
examples
ipc Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown 2020-02-27 17:39:15 +00:00
public Bug 1275508 - Remove werror. r=jandem 2020-03-11 12:20:21 +00:00
rust Bug 1621044 - Tentative fix for the SM-rust build bustage. 2020-03-11 00:06:44 +00:00
src Bug 1566427 - Improved compiler availability computation. r=bbouvier 2020-03-11 07:53:03 +00:00
xpconnect Bug 1275508 - Remove JavaScript werror from browser. r=mccr8 2020-03-11 12:20:21 +00:00
app.mozbuild
ffi.configure
moz.build Bug 1614622 part 8 - Remove optimization tracking files. r=djvj 2020-02-17 09:17:46 +00:00
moz.configure Bug 1566427 - Improved compiler availability computation. r=bbouvier 2020-03-11 07:53:03 +00:00
sub.configure