Commit Graph

3333 Commits

Author SHA1 Message Date
Ted Campbell
d2f16d6095 Bug 1788977 - Consolidate methods for finishing off-thread JS parse/decode. r=arai
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
2022-09-06 12:01:35 +00:00
Ted Campbell
db4c7cad42 Bug 1788977 - Remove extraneous setDeferDebugMetadata calls in jsshell. r=arai
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
2022-09-06 12:01:35 +00:00
Ted Campbell
e797160888 Bug 1788977 - Cleanup Evaluate function in jsshell. r=arai
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
2022-09-06 12:01:34 +00:00
Ted Campbell
84829b3d54 Bug 1788977 - Add 'execute' flag to jsshell Evaluate function. r=arai
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
2022-09-06 12:01:34 +00:00
Mohamed Atef
d6af0e702b Bug 1786117: Use ErrorContext-variant of ReportOutOfMemory in Stencil XDR. r=arai,bthrall
Differential Revision: https://phabricator.services.mozilla.com/D155433
2022-09-02 18:52:09 +00:00
Nicolas B. Pierron
b26c6a9f15 Bug 1779940 part 3 - Add dummy ScopeBindingCache, and get it across. r=arai
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
2022-08-25 15:03:30 +00:00
André Bargull
78ad264c91 Bug 1786471 - Part 3: Remove unnecessary includes from js/src/frontend. r=jonco
Depends on D155343

Differential Revision: https://phabricator.services.mozilla.com/D155344
2022-08-23 13:48:31 +00:00
criss
18a8484c33 Backed out 3 changesets (bug 1786471) for causing SM failures on jsrtfuzzing.cpp . CLOSED TREE
Backed out changeset 64c823e0df9c (bug 1786471)
Backed out changeset 5723d1994900 (bug 1786471)
Backed out changeset 53910f7dd1f8 (bug 1786471)
2022-08-23 13:08:50 +03:00
André Bargull
2c9f244947 Bug 1786471 - Part 3: Remove unnecessary includes from js/src/frontend. r=jonco
Depends on D155343

Differential Revision: https://phabricator.services.mozilla.com/D155344
2022-08-23 09:38:03 +00:00
Bryan Thrall
e47a330f10 Bug 1782569 - Pass ErrorContext to ReportOutOfMemory() for ParserAtom, ParserAtomsTable, ScriptSource, SharedImmutableScriptData r=nbp
Instantiating stencils happens on the main thread, so
InstantiateModuleStencil(), and InstantiateModuleStencilXDR() can safely use
MainThreadErrorContext.

Differential Revision: https://phabricator.services.mozilla.com/D154464
2022-08-19 14:59:25 +00:00
Bryan Thrall
b9bfb7ca2c Bug 1782569 - Pass ErrorContext to ReportoutOfMemory for Stencil. r=nbp
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
2022-08-19 14:59:22 +00:00
Bryan Thrall
5f969eeac5 Bug 1782569 - Add ErrorContext member to SharedContext r=nbp
We will use it with ReportOutOfMemory() calls and probably other places.

Specifically: FunctionBox::setAsmJSModule() calls ReportOutOfMemory().

Differential Revision: https://phabricator.services.mozilla.com/D153966
2022-08-19 14:59:20 +00:00
Jon Coppeard
82bd1b7473 Bug 1693223 - Improve gray marking assertions to take account of clearing mark bits off-thread r=sfink
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
2022-08-18 20:14:21 +00:00
André Bargull
4b0f41f774 Bug 1783703 - Part 2: Change-Array-By-Copy flag should be a RealmCreationOptions. r=mgaudet
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
2022-08-09 09:50:29 +00:00
André Bargull
e9cf14a263 Bug 1783703 - Part 1: Remove ContextOptions::arrayGrouping(). r=mgaudet
There's already a realm creation option for this feature.

Differential Revision: https://phabricator.services.mozilla.com/D153982
2022-08-09 09:50:28 +00:00
Tooru Fujisawa
e66fc9941d Bug 1782705 - Part 2: Add JS::NativeStackLimit parameter to smoosh functions. r=bthrall
Depends on D153819

Differential Revision: https://phabricator.services.mozilla.com/D153820
2022-08-09 06:47:15 +00:00
Tooru Fujisawa
34eded40df Bug 1781255 - Part 1: Add JS::NativeStackLimit parameter to compilation functions. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D152855
2022-08-04 05:11:16 +00:00
Tooru Fujisawa
3f50679a1d Bug 1782166 - Part 1: Add JSScript::dump and move shell dis() function implementation into it. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D153220
2022-08-02 13:56:27 +00:00
Matthew Gaudet
e36527b60b Bug 1782271 - Remove Warp async and generator options r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D153231
2022-08-02 13:41:01 +00:00
Jan de Mooij
2d245c757d Bug 1782188 - Use more reliable endStackAddress when profiling JIT/Wasm frames. r=iain
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
2022-08-01 11:10:52 +00:00
Tooru Fujisawa
04996c8ede Bug 1781183 - Part 3: Add ParserBase::stackLimit_. r=bthrall
Depends on D152773

Differential Revision: https://phabricator.services.mozilla.com/D152774
2022-07-30 04:45:18 +00:00
Jon Coppeard
d548e53821 Bug 1779421 - Part 3: Add tests for expected module status and async evaluating state r=yulia
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
2022-07-28 09:08:28 +00:00
Ryan Hunt
9865684fd5 Bug 1781425 - wasm: Remove baldrdash. r=jseward,supply-chain-reviewers
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
2022-07-27 22:30:17 +00:00
Yury Delendik
225a541507 Bug 1762409 - Remove wormhole instructions. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D152118
2022-07-26 22:39:37 +00:00
Bryan Thrall
de04e145b0 Bug 1773324 - Pass ErrorContext down through Smoosh functions r=arai
Differential Revision: https://phabricator.services.mozilla.com/D152458
2022-07-25 18:57:38 +00:00
Bryan Thrall
ea48d65b20 Bug 1773324 - Rename MainThreadErrorContext r=arai
"GenericErrorContext" hasn't been an appropriate name since 5d4105313417.

Differential Revision: https://phabricator.services.mozilla.com/D151667
2022-07-25 18:57:35 +00:00
Bryan Thrall
7faf57ca9b Bug 1773324 - Pass ErrorContext parameter to CompileModuleToStencil functions r=arai
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
2022-07-25 18:57:31 +00:00
Bryan Thrall
d39a4863e1 Bug 1773324 - Plumb ErrorContext parameter out to where main vs. helper thread is known r=arai
Differential Revision: https://phabricator.services.mozilla.com/D150643
2022-07-25 18:57:30 +00:00
Bryan Thrall
473d39f7e9 Bug 1773324 - Provide Parser ErrorContext as a constructor parameter. r=arai
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
2022-07-25 18:57:30 +00:00
Ted Campbell
b800cab6d6 Bug 1776931 - Use types for SpiderMonkey telemetry. r=jandem,jonco
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
2022-07-21 17:51:36 +00:00
Ted Campbell
954201f5cc Bug 1776931 - Add JSMetric enum class for SpiderMonkey telemetry. r=jonco
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
2022-07-21 17:51:35 +00:00
Dan Minor
06e3cf6dc2 Bug 1775026 - Ship Array.{findLast,findLastIndex}; r=yulia
This removes the pref and options for findLast and findLastIndex so that
they are shipped by default.

Differential Revision: https://phabricator.services.mozilla.com/D150633
2022-07-13 16:39:30 +00:00
Matthew Gaudet
36f63dff50 Bug 1777529 - Remove Tracelogger support from Shell r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D150779
2022-07-13 15:26:52 +00:00
Jon Coppeard
8a65bfb2f7 Bug 1778318 - Part 3: Remove prototypes for internal module objects r=arai
Since these no longer have any methods or getters we can give them null prototypes.

Depends on D151134

Differential Revision: https://phabricator.services.mozilla.com/D151135
2022-07-06 14:21:17 +00:00
Jim Blandy
018ca4cf35 Bug 1777413: Permit zero-length external ArrayBuffers. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D150701
2022-07-05 20:20:39 +00:00
Jon Coppeard
aef7519b4a Bug 1778076 - Part 5: Replace ModuleObject methods with shell functions r=arai
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
2022-07-05 13:04:55 +00:00
Cosmin Sabou
d7066f82f3 Backed out changeset a3e646ff4b21 (bug 1777413) for causing jsreftest failures on ArrayBuffer/bug1777413.js. 2022-06-30 22:57:55 +03:00
Jim Blandy
22eb5b2c8b Bug 1777413: Permit zero-length external ArrayBuffers. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D150701
also remove redundant assertion that a size_t >= 0.
2022-06-30 18:55:29 +00:00
Cosmin Sabou
630c388273 Backed out changeset bd61ede3832f (bug 1777413) for causing SM bustages. 2022-06-30 22:00:54 +03:00
Jim Blandy
31cfe7667a Bug 1777413: Permit zero-length external ArrayBuffers. r=tcampbell
Depends on D150624

Differential Revision: https://phabricator.services.mozilla.com/D150701
2022-06-30 18:27:41 +00:00
Matthew Gaudet
18a19d61d4 Bug 1767525 - Implement (under a flag) ShadowRealm constructor and evaluate function. r=jandem
Shell only, without HostInitializeShadowRealm, nor importValue

Differential Revision: https://phabricator.services.mozilla.com/D146236
2022-06-28 22:04:16 +00:00
Csoregi Natalia
d91db2b437 Backed out 9 changesets (bug 1747059, bug 1767525)for causing hazard failures on ShadowRealmGlobalScope.cpp. CLOSED TREE
Backed out changeset ed7aad37f2cf (bug 1747059)
Backed out changeset 40a257fb4788 (bug 1747059)
Backed out changeset f7b049ef3b8c (bug 1747059)
Backed out changeset aad38abc7139 (bug 1747059)
Backed out changeset 8115813e77a5 (bug 1747059)
Backed out changeset e06192e664fd (bug 1747059)
Backed out changeset a198b0893220 (bug 1767525)
Backed out changeset c083f0824619 (bug 1767525)
Backed out changeset 9a3bf794ec6d (bug 1767525)
2022-06-28 02:39:08 +03:00
Matthew Gaudet
82ce47d374 Bug 1767525 - Implement (under a flag) ShadowRealm constructor and evaluate function. r=jandem
Shell only, without HostInitializeShadowRealm, nor importValue

Differential Revision: https://phabricator.services.mozilla.com/D146236
2022-06-27 21:17:34 +00:00
Iain Ireland
b774266d17 Bug 1704385: Add pref for Array.findLast r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D148330
2022-06-16 22:01:06 +00:00
Jon Coppeard
853b206733 Bug 1773778 - Part 7: Remove deprecated GCPtrObject typedef r=tcampbell
Depends on D149116

Differential Revision: https://phabricator.services.mozilla.com/D149117
2022-06-14 12:30:10 +00:00
Ted Campbell
9313467da7 Bug 1773368 - Remove deprecated internal typedefs for string-related types. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D148955
2022-06-13 17:09:46 +00:00
Ted Campbell
7ae1c9d648 Bug 1773368 - Remove deprecated typedefs for ArrayObject. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D148822
2022-06-10 15:58:10 +00:00
Ted Campbell
196dcd5625 Bug 1773368 - Remove deprecated typedefs for NativeObject. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D148821
2022-06-10 15:58:10 +00:00
Ted Campbell
61ad5e768c Bug 1773368 - Remove deprecated typedefs for wasm objects. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D148818
2022-06-10 15:58:08 +00:00
Ted Campbell
079812fdd3 Bug 1773368 - Remove deprecated typedefs from JS SavedFrame code. r=iain
Depends on D148701

Differential Revision: https://phabricator.services.mozilla.com/D148702
2022-06-09 00:38:32 +00:00