Off-thread parse and decode all generate JS::Stencils so the various
specializations are not needed for methods that collect the results back to
main-thread.
Depends on D156335
Differential Revision: https://phabricator.services.mozilla.com/D156336
The OffThreadCompileToStencil call doesn't use debug metadata so it should not
be requesting deferred metadata initialization.
Depends on D156334
Differential Revision: https://phabricator.services.mozilla.com/D156335
Stop using CompileAndStartIncrementalEncoding in the shell and use the
StartIncrementalEncoding method instead. Share the stencil-instantiation code
between the decode and parse paths.
Depends on D156333
Differential Revision: https://phabricator.services.mozilla.com/D156334
Replace the 'transcodeOnly' flag with an 'execute' flag and remove the unused
Compile function. Also fix parsemark.py compile options to pass cache checks.
Differential Revision: https://phabricator.services.mozilla.com/D156333
This patch isolate the boiler plate code to create a dummy ScopeBindingCache
with no logic to split the noise of this not-so mechanical patch driven by
compiler error messages.
This patch modify the interface of every function, adding the option to provide
a custom ScopeBindingCache when parsing a Stencil, except for publicly facing
functions such as from `js/public/experimental/JSStencil.h`.
The intent being that Helper thread functions, which are relying on Stencil
should have their own ScopeBindingCache which is either unused, or dedicated to
caching the bindings of multiple delazifications. The reasons are that in the
future we are interested in stripping the JSContext* out of HelperThreads, and
that there is no value in sharing the content across threads.
Differential Revision: https://phabricator.services.mozilla.com/D154513
Instantiating stencils happens on the main thread, so
InstantiateModuleStencil(), and InstantiateModuleStencilXDR() can safely use
MainThreadErrorContext.
Differential Revision: https://phabricator.services.mozilla.com/D154464
To keep this patch simple to follow, I introduce some temporary functions
(initVector, initMap, setInitial, addDelazification) so I can plumb
ErrorContext through StencilXdr and ParseAtom in separate patches.
Differential Revision: https://phabricator.services.mozilla.com/D153971
We will use it with ReportOutOfMemory() calls and probably other places.
Specifically: FunctionBox::setAsmJSModule() calls ReportOutOfMemory().
Differential Revision: https://phabricator.services.mozilla.com/D153966
I don't know whether this will fix this issue, but our assertions are
definitely over restrictive here.
The mark bits are accessed atomically, and are cleared on a background thread.
If the mark bits for a cell span two words (which happens for some cell sizes)
we may observe a cell that had both mark bits set (i.e. black) as having only
one bit set, and thus appear to be gray.
The patch checks whether parallel unmarking is taking place and skips the gray
check.
Differential Revision: https://phabricator.services.mozilla.com/D154794
Built-ins are created when the realm is created (at least according to the spec),
so it should be a RealmCreationOptions.
Differential Revision: https://phabricator.services.mozilla.com/D153983
We were using the activation's exitFP for this, but that value isn't cleared
when we return to JIT code from C++ so we could use stale values if we're in JIT
code (or used `callWithABI` calls without an exit frame). This could result in
unsymbolicated frames or missing frames in profiles.
This patch changes the JIT and Wasm frame iterators to set `endStackAddress` from
their constructor. In the outer iterator we then keep track of the first value for
the current activation and use that instead of the activation's exitFP.
Adds an assertion to the single-step callback to check `frame.endStackAddress >= state.sp`
in simulator builds. This failed on many jit-tests before this patch and passes now.
Differential Revision: https://phabricator.services.mozilla.com/D153214
This adds a shell function 'clearModules' to clear all loaded modules, so that
tests can be insulated from one another.
Depends on D151834
Differential Revision: https://phabricator.services.mozilla.com/D151835
The baldrdash integration of Cranelift is agreed between SM and CL
to be the wrong shape. Our import of the code base is also old and
causes difficulties for us when upgrading some crates (see bug
1774829). We should remove it for now to unblock bug 1774829.
Differential Revision: https://phabricator.services.mozilla.com/D152806
Fixes jit-test. Probably needs coordination with ESMification efforts.
It looks like JS::CompileModule() would be called from the main thread, so
it should use GeneralErrorContext.
Differential Revision: https://phabricator.services.mozilla.com/D151178
This allows the Parser creator to provide the ErrorContext appropriate
for the situation (main thread or helper thread). For now, we just use
a flexible implementation.
I think the lifetime of the ErrorContext is the same as the Parser, so
putting the ErrorContext on the stack when the Parser is, too, should be
safe.
Differential Revision: https://phabricator.services.mozilla.com/D150642
Similar to Glean FoG, use types for telemetry metrics. For our existing probes,
this is mainly about using TimeDuration directly. The reported values continue
to be unchanged.
Differential Revision: https://phabricator.services.mozilla.com/D150659
Replace the JS_TELEMETRY_* enums with a JSMetric enum class. Use this to
generate the XPCJSRuntime mapping automatically.
Differential Revision: https://phabricator.services.mozilla.com/D150657
This replaces the methods 'declarationInstantiation' and 'evaluation' with
shell functions moduleLink and moduleEvaluate and updates the test code.
Differential Revision: https://phabricator.services.mozilla.com/D151015