Commit Graph
108 Commits
Author SHA1 Message Date
Yoshi Cheng-Hao Huang 2f395ffaf7 Bug 1820594 - Part 18: Add mReferrerObj, mModuleRequestObj, mReferencingPrivate, mStatePrivate in ModuleLoadRequest r=jonco
Add data structures to pass those information to
FinishLoadingImportedModule.

Differential Revision: https://phabricator.services.mozilla.com/D228852
2025-07-22 18:29:07 +00:00
Yoshi Cheng-Hao Huang 5c786aae1f Bug 1820594 - Part 16: Call LoadRequestedModules in StartFetchingModuleDependencies. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D251142
2025-07-22 18:28:58 +00:00
Yoshi Cheng-Hao Huang 00a8ab1fce Bug 1820594 - Part 14: Remove VisitedURLSet. r=jonco
Visited set has been removed from the spec.
See https://whatpr.org/html/8253/085d4d1...75e7bf0/webappapis.html

Differential Revision: https://phabricator.services.mozilla.com/D228850
2025-07-22 18:28:52 +00:00
Atila Butkovits f46ece6f70 Revert "Bug 1820594 - Part 36: Add CancelFetchingModules. r=jonco" for causing failures at mochitest.toml.
This reverts commit bb9106dfec.

Revert "Bug 1820594 - Part 35: Disable testSyncImportWhileAsyncImportTLA. r=arai"

This reverts commit bd7ac6c6da.

Revert "Bug 1820594 - Part 34: Update wpt ini for dynamic import. r=jonco"

This reverts commit 6dc30859a2.

Revert "Bug 1820594 - Part 33: Update choice-of-error-1.html.ini and error-type-1.html.ini failed as expected. r=jonco"

This reverts commit 696d4051b2.

Revert "Bug 1820594 - Part 32: Remove js/src/jit-test/tests/modules/bug-1287410.js. r=jonco"

This reverts commit 6a47bd9a7c.

Revert "Bug 1820594 - Part 31: Test the child requests accross multiple module graphs. r=jonco"

This reverts commit fc403c5ea9.

Revert "Bug 1820594 - Part 30: Update JS Shell implementation for HostLoadImportedModule. r=jonco"

This reverts commit 5a2f281ba7.

Revert "Bug 1820594 - Part 29: Remove ModuleLoader::ResolveImportedModule and ModuleLoader::ImportModuleDynamically in JS Shell r=jonco"

This reverts commit aa686310fc.

Revert "Bug 1820594 - Part 28: DOM, Worker, Worklet ScriptLoader, mozJSModuleLoader update r=jonco"

This reverts commit 86aea74da6.

Revert "Bug 1820594 - Part 27: Remove redundant module graph data structures from host layer. r=jonco"

This reverts commit 81673cfb4e.

Revert "Bug 1820594 - Part 26: Remove FindFirstParseError and check for parse error. r=jonco"

This reverts commit 665970f847.

Revert "Bug 1820594 - Part 25: Call FinishLoadingImportedModule for dynamic import. r=jonco"

This reverts commit 9037595d27.

Revert "Bug 1820594 - Part 24: Add ModuleErroredRunnable to dispatch ModuleErrored. r=jonco"

This reverts commit aa0e96e6c1.

Revert "Bug 1820594 - Part 23: Error handling when module fetching failed. r=jonco"

This reverts commit 8054f6d6b3.

Revert "Bug 1820594 - Part 22: Throw TypeError if the module type is unsupported. r=jonco"

This reverts commit f793f2b086.

Revert "Bug 1820594 - Part 21: Implement HostLoadImportedModule and FinishLoadingImportedModule in ModuleLoaderBase. r=jonco"

This reverts commit 2c2abeb8a3.

Revert "Bug 1820594 - Part 20: Update module script's referrer policy. r=jonco"

This reverts commit e92cdaa129.

Revert "Bug 1820594 - Part 19: Refactor CreateStaticImport. r=jonco"

This reverts commit e7cc5dcf27.

Revert "Bug 1820594 - Part 18: Add mReferrerObj, mModuleRequestObj, mReferencingPrivate, mStatePrivate in ModuleLoadRequest r=jonco"

This reverts commit 96b553c522.

Revert "Bug 1820594 - Part 17: Add OnFetchSucceeded r=jonco"

This reverts commit 4b60b4037a.

Revert "Bug 1820594 - Part 16-1 : Use sync version of LoadRequestedModules for chrome pages. r=jonco"

This reverts commit a75c3d1989.

Revert "Bug 1820594 - Part 16: Call LoadRequestedModules in StartFetchingModuleDependencies. r=jonco"

This reverts commit cf9a4a886d.

Revert "Bug 1820594 - Part 15: Remove HostResolveImportedModule and HostImportModuleDynamically r=jonco"

This reverts commit 8c45c3380e.

Revert "Bug 1820594 - Part 14: Remove VisitedURLSet. r=jonco"

This reverts commit 09f1ea1a1a.

Revert "Bug 1820594 - Part 13: Resume waiting requests after fetching dependencies. r=jonco"

This reverts commit a5edee9705.

Revert "Bug 1820594 - Part 12: Implement ContinueDynamicImport. r=jonco"

This reverts commit b487d8ffec.

Revert "Bug 1820594 - Part 11: Implement LoadRequestedModules. r=jonco"

This reverts commit 0049bf82d1.

Revert "Bug 1820594 - Part 10: Implement ImportAttributes in InnerModuleLoading. r=jonco"

This reverts commit 3115d8a191.

Revert "Bug 1820594 - Part 9: Implement FinishLoadingImportedModule, ContinueModuleLoading. r=jonco"

This reverts commit 85bcdccef3.

Revert "Bug 1820594 - Part 8: Update js::FinishDynamicModuleImport. r=jonco"

This reverts commit f5546f06d2.

Revert "Bug 1820594 - Part 7: Remove JS::FinishDynamicModuleImport. r=jonco"

This reverts commit 1e6d8581b9.

Revert "Bug 1820594 - Part 6: Implement InnerModuleLoading. r=jonco"

This reverts commit ef4d03deaf.

Revert "Bug 1820594 - Part 5: Update Module Hook. r=jonco"

This reverts commit 4f00fb82af.

Revert "Bug 1820594 - Part 4: Implement GetImportedModule. r=jonco"

This reverts commit 19507524a2.

Revert "Bug 1820594 - Part 3: Implement LoadedModules in ModuleObject. r=jonco"

This reverts commit f639c7eb96.

Revert "Bug 1820594 - Part 2: Implement GraphLoadingStateRecord. r=jonco"

This reverts commit 05a2b76d9c.

Revert "Bug 1820594 - Part 1: Add ModuleStatus::New. r=jonco"

This reverts commit bfd2615ef1.
2025-07-22 01:03:15 +00:00
Yoshi Cheng-Hao Huang 81673cfb4e Bug 1820594 - Part 27: Remove redundant module graph data structures from host layer. r=jonco
Since the module graph is now traversed within the JS engine itself, the
related data structures in the host layer are no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D255129
2025-07-21 23:09:41 +00:00
Yoshi Cheng-Hao Huang 8054f6d6b3 Bug 1820594 - Part 23: Error handling when module fetching failed. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D228860
2025-07-21 23:09:29 +00:00
Yoshi Cheng-Hao Huang 96b553c522 Bug 1820594 - Part 18: Add mReferrerObj, mModuleRequestObj, mReferencingPrivate, mStatePrivate in ModuleLoadRequest r=jonco
Add data structures to pass those information to
FinishLoadingImportedModule.

Differential Revision: https://phabricator.services.mozilla.com/D228852
2025-07-21 23:09:14 +00:00
Yoshi Cheng-Hao Huang cf9a4a886d Bug 1820594 - Part 16: Call LoadRequestedModules in StartFetchingModuleDependencies. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D251142
2025-07-21 23:09:06 +00:00
Yoshi Cheng-Hao Huang 09f1ea1a1a Bug 1820594 - Part 14: Remove VisitedURLSet. r=jonco
Visited set has been removed from the spec.
See https://whatpr.org/html/8253/085d4d1...75e7bf0/webappapis.html

Differential Revision: https://phabricator.services.mozilla.com/D228850
2025-07-21 23:09:00 +00:00
Tooru Fujisawa 2383b98374 Bug 1954644 - Part 3: Cleanup ModuleLoadRequest parameters to avoid confusing parameter syntax. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242308
2025-03-22 04:03:54 +00:00
Jonatan Klemets 5d9da99e61 Bug 1877792 - Part 8: Add module type to ModuleLoadRequest::NewVisitedSetForTopLevelImport r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds the new parameter to the `NewVisitedSetForTopLevelImport`
method, but we hard-code the module type (which will be addressed in a later
patch)

Differential Revision: https://phabricator.services.mozilla.com/D218555
2024-09-03 08:10:50 +00:00
Jonatan Klemets becd3a556a Bug 1877792 - Part 7: Add ModuleLoadRequest::mModuleType r=dom-core,spidermonkey-reviewers,dom-worker-reviewers,asuth,jonco,mccr8
This patch gets rid of most hard-coded `JS::ModuleType::JavaScript` in
`js/loader/ModuleLoaderBase.cpp`. However, the module type is still hard-coded
when constructing the `ModuleLoadRequest` (will be addressed in a later patch).

Differential Revision: https://phabricator.services.mozilla.com/D218554
2024-09-03 08:10:50 +00:00
Jonatan Klemets c5a80d9d47 Bug 1877792 - Part 3: Update module map methods to take ModuleMapKey instead of nsIURI r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218209
2024-09-03 08:10:48 +00:00
Jonatan Klemets 0598953bb0 Bug 1877792 - Part 2: Change the module map key to include both URL and module type r=yulia,jonco
The module maps (`mFetchingModules` and `mFetchedModules`) in
`ModuleLoaderBase`, and `VisitedURLSet` were previously only keyed by the URL
and used the `nsURIHashKey` hashtable key class. This is no longer sufficient,
and the key should also contain the module type.

This patch introduces a new hashtable key class called `ModuleMapKey` and
changes `mFetchingModules`, `mFetchedModules`, and `VisitedURLSet` to use the
new key type.

To make this a bit easier to review, this first patch only introduces the new
key type and hard-codes the type to Javascript, where the key is constructed.
The hard-corded module types will be fixed in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D155160
2024-09-03 08:10:48 +00:00
Cristina Horotan a842adb0d9 Backed out 20 changesets (bug 1877792) for causing wpt failures at importscripts_mime_local.any.sharedworker.html CLOSED TREE
Backed out changeset 19d78d0b6ee4 (bug 1877792)
Backed out changeset 14f104e5ce51 (bug 1877792)
Backed out changeset 662eb52b2a6f (bug 1877792)
Backed out changeset 48dc4035a14f (bug 1877792)
Backed out changeset d98ecddf2f59 (bug 1877792)
Backed out changeset 1234a31ff88f (bug 1877792)
Backed out changeset a3b5b0cde6ce (bug 1877792)
Backed out changeset a1f494b9592a (bug 1877792)
Backed out changeset a4d7565218f3 (bug 1877792)
Backed out changeset fe179004423b (bug 1877792)
Backed out changeset 39a20aee3942 (bug 1877792)
Backed out changeset 95b20763e650 (bug 1877792)
Backed out changeset d763241fccaf (bug 1877792)
Backed out changeset 0674cf646120 (bug 1877792)
Backed out changeset bd23c96418b6 (bug 1877792)
Backed out changeset 5b1e29e4c597 (bug 1877792)
Backed out changeset 3cead4149e6b (bug 1877792)
Backed out changeset d73a9f57f03c (bug 1877792)
Backed out changeset 82a58a80f58a (bug 1877792)
Backed out changeset 4c7182604e4f (bug 1877792)
2024-08-22 19:23:15 +03:00
Jonatan Klemets 1d65cffc8b Bug 1877792 - Part 8: Add module type to ModuleLoadRequest::NewVisitedSetForTopLevelImport r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds the new parameter to the `NewVisitedSetForTopLevelImport`
method, but we hard-code the module type (which will be addressed in a later
patch)

Differential Revision: https://phabricator.services.mozilla.com/D218555
2024-08-22 14:21:51 +00:00
Jonatan Klemets fa63416707 Bug 1877792 - Part 7: Add ModuleLoadRequest::mModuleType r=dom-core,spidermonkey-reviewers,dom-worker-reviewers,asuth,jonco,mccr8
This patch gets rid of most hard-coded `JS::ModuleType::JavaScript` in
`js/loader/ModuleLoaderBase.cpp`. However, the module type is still hard-coded
when constructing the `ModuleLoadRequest` (will be addressed in a later patch).

Differential Revision: https://phabricator.services.mozilla.com/D218554
2024-08-22 14:21:50 +00:00
Jonatan Klemets bf0dcb0282 Bug 1877792 - Part 3: Update module map methods to take ModuleMapKey instead of nsIURI r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218209
2024-08-22 14:21:49 +00:00
Jonatan Klemets c0c83bb35e Bug 1877792 - Part 2: Change the module map key to include both URL and module type r=yulia,jonco
The module maps (`mFetchingModules` and `mFetchedModules`) in
`ModuleLoaderBase`, and `VisitedURLSet` were previously only keyed by the URL
and used the `nsURIHashKey` hashtable key class. This is no longer sufficient,
and the key should also contain the module type.

This patch introduces a new hashtable key class called `ModuleMapKey` and
changes `mFetchingModules`, `mFetchedModules`, and `VisitedURLSet` to use the
new key type.

To make this a bit easier to review, this first patch only introduces the new
key type and hard-codes the type to Javascript, where the key is constructed.
The hard-corded module types will be fixed in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D155160
2024-08-22 14:21:48 +00:00
Yoshi Cheng-Hao Huang d48c09dbea Bug 1894631 - Add CancelingImport state in ScriptLoadRequest::State. r=jonco
In the following module graph:

0.html
    +---- 1.mjs
        +---- 2.mjs (modulepreload)
            +---- 3.mjs (modulepreload)
            +---- 4.mjs
        +---- non_existing.mjs

Fetching non_existing.mjs will fail, which will notify its parent module
1.mjs with ModuleErrored(), and then 1.mjs will cancel its imports.

The sequence is as follows:
1. 1.mjs cancels 2.mjs, 2.mjs changes to Cancel state
2. 2.mjs cancels 3.mjs, 3.mjs is already preloaded, its state still remains Finished.
3. 2.mjs cancels 4.mjs, 4.mjs changes to Cancel state.

Now, 2.mjs will call ChildLoadComplete[1], which will call 1.mjs
ModuleErrored()[2] again (The 1st time is called when loading non_existing.mjs failed)

Now 1.mjs wants to cancel 2.mjs again, and 2.mjs has been canceled
previously, so it will do AssertAllImportsCanceled() check[3].

However, 3.mjs has been fetched by <modulepreload> and is in Finished
state, which triggers the assertion failure.

To fix this, I add a new state in ScriptLoadRequest::State called
CancelingImport, to fix the problem the CancelImport() call is called by
non_existing.mjs and 2.mjs.

[1]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/js/loader/ModuleLoadRequest.cpp#100
[2]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/js/loader/ModuleLoaderBase.cpp#954
[3]: https://searchfox.org/mozilla-central/rev/f1532761de0b60337e42c6c3f525288a523dabef/js/loader/ModuleLoadRequest.cpp#86

Differential Revision: https://phabricator.services.mozilla.com/D209218
2024-05-07 16:03:20 +00:00
Yoshi Cheng-Hao Huang 3c82f6e2c6 Bug 1893164 - Make CancelImport() won't cancel a request if the URI is been waiting by other requests. r=jonco
In the following module graph:

0.html
  +---- 1.mjs
    +---- non_existing.mjs
    +---- 3.mjs
  +----- 2.mjs
    +---- 3.mjs

Both 1.mjs and 2.mjs have a common submodule called 3.mjs
But 1.mjs also has a non-existing submodule, so we can't instantiate the
module graph of 1.mjs. which in turn will cancel 3.mjs

But 3.mjs is also a sub-module of 2.mjs, so in order to instantiate the
module graph of 2.mjs, we skip canceling 3.mjs when we processed 1.mjs

Differential Revision: https://phabricator.services.mozilla.com/D209210
2024-05-07 16:03:20 +00:00
Jon Coppeard 12d9fbf2d4 Bug 1877703 - Part 1: Remove speculatively preloaded modules from the module map when import map is registered r=smaug,allstarschh
The initial problem reported in the bug is that we try to speculatively load a
bareword import before the import map is dynamically inserted that makes that
load valid. The load fails and then we cache the failure in the module map.

The more general problem is that import maps change the locations that imports
are resolved to so if when there is a dynamically inserted import map
speculative preload may load and cache the wrong things.

This patch fixes this problem by removing any preloaded modules from the module
map when an import map is registered.

Previously we used to do something like this but it was changed because I
wasn't confident that it wouldn't remove too much. However it appears that this
is necessary to handle this situation, so it's implemented here but with more
checks that it only removes preloaded modules. This is handled by adding extra
flags where necessary so we have the information on hand to check.

I've made these diagnostic asserts so that this actually gets check in real use.

Differential Revision: https://phabricator.services.mozilla.com/D202611
2024-03-19 10:07:34 +00:00
Norisz Fay d4dacb8c6c Backed out 4 changesets (bug 1877703) as requested by dev for causing Bug 1885443
Backed out changeset 5eb60e36ef79 (bug 1877703)
Backed out changeset 5921d1fb831e (bug 1877703)
Backed out changeset 64281b11237e (bug 1877703)
Backed out changeset 7ee0827809fb (bug 1877703)
2024-03-15 13:28:07 +02:00
Jon Coppeard cb76d1f909 Bug 1877703 - Part 1: Remove speculatively preloaded modules from the module map when import map is registered r=smaug,allstarschh
The initial problem reported in the bug is that we try to speculatively load a
bareword import before the import map is dynamically inserted that makes that
load valid. The load fails and then we cache the failure in the module map.

The more general problem is that import maps change the locations that imports
are resolved to so if when there is a dynamically inserted import map
speculative preload may load and cache the wrong things.

This patch fixes this problem by removing any preloaded modules from the module
map when an import map is registered.

Previously we used to do something like this but it was changed because I
wasn't confident that it wouldn't remove too much. However it appears that this
is necessary to handle this situation, so it's implemented here but with more
checks that it only removes preloaded modules. This is handled by adding extra
flags where necessary so we have the information on hand to check.

I've made these diagnostic asserts so that this actually gets check in real use.

Differential Revision: https://phabricator.services.mozilla.com/D202611
2024-03-13 13:25:29 +00:00
Norisz Fay 88f0544e64 Backed out 4 changesets (bug 1877703) for causing ScriptLoader related wpt failures
Backed out changeset 6b99c1c567b4 (bug 1877703)
Backed out changeset bc9c70289244 (bug 1877703)
Backed out changeset 1e17b87ab7f8 (bug 1877703)
Backed out changeset 591b5483bcd8 (bug 1877703)
2024-03-12 23:43:16 +02:00
Jon Coppeard 0a6e28c113 Bug 1877703 - Part 1: Remove speculatively preloaded modules from the module map when import map is registered r=smaug,allstarschh
The initial problem reported in the bug is that we try to speculatively load a
bareword import before the import map is dynamically inserted that makes that
load valid. The load fails and then we cache the failure in the module map.

The more general problem is that import maps change the locations that imports
are resolved to so if when there is a dynamically inserted import map
speculative preload may load and cache the wrong things.

This patch fixes this problem by removing any preloaded modules from the module
map when an import map is registered.

Previously we used to do something like this but it was changed because I
wasn't confident that it wouldn't remove too much. However it appears that this
is necessary to handle this situation, so it's implemented here but with more
checks that it only removes preloaded modules. This is handled by adding extra
flags where necessary so we have the information on hand to check.

I've made these diagnostic asserts so that this actually gets check in real use.

Differential Revision: https://phabricator.services.mozilla.com/D202611
2024-03-12 16:43:48 +00:00
Tooru Fujisawa ae550fe36e Bug 1880708 - Handle CC unlink when destroying ScriptLoader/ModuleLoader. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D202080
2024-02-19 15:09:00 +00:00
Tooru Fujisawa 8d9ed15dd6 Bug 1875836 - Part 1: Add ModuleLoadRequest::SetDynamicImport method. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D199278
2024-01-23 23:29:53 +00:00
Tooru Fujisawa 9b4d6d328e Bug 1800641 - Part 7: Add ScriptLoadRequest::State::{CheckingCache,PendingFetchingError}. r=nbp
Depends on D197844

Differential Revision: https://phabricator.services.mozilla.com/D197845
2024-01-08 14:57:38 +00:00
Jon Coppeard 9c329cdb6e Bug 1871075 - Part 1: Store referencing private as a pointer to the underlying LoadedScript r=yulia
In Gecko we use a LoadedScript pointer as the referencing private for dynamic
imports. This is passed through the JS engine as a private value, which doesn't
care what it means. Currently we store this in the module loader as a JS::Value,
but we could just as well unpack it since we know what it is. That lets use a
RefPtr which also keeps it alive and will let use remove some manual reference
counting.

We also don't need to pass it to the CreateDynamicImport method twice.

This change makes it the responsibility of the module loader for keeping the
referencing private alive until FinishDynamicModuleImport is called.

Differential Revision: https://phabricator.services.mozilla.com/D196974
2023-12-21 13:30:34 +00:00
Yoshi Cheng-Hao Huang 2b03ca80a7 Bug 1841859 - Part 1: Move ReferrerPolicy to ScriptLoadRequest and LoadedScript. r=jonco,smaug
Suggested by jonco during review,
https://phabricator.services.mozilla.com/D186944#inline-1036982

Differential Revision: https://phabricator.services.mozilla.com/D187385
2023-09-20 17:32:15 +00:00
Jon Coppeard bee296d117 Bug 1843838 - Rename ScriptLoadRequest::IsReadyToRun to IsFinished since this returns true for cancelled requests r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183740
2023-08-04 09:40:40 +00:00
Jon Coppeard 1e096c450d Bug 1842798 - Part 2: Remove use of MozPromise to wait for module imports to load r=smaug
This replaces the use of a promise to wait for all imports of a module to load
with a counter of reminaing imports in the parent and a pointer to the parent
that is waiting in the child. The parent request is updated immediately rather
than by dispatching a runnable.

Differential Revision: https://phabricator.services.mozilla.com/D183273
2023-08-03 08:15:29 +00:00
Narcis Beleuzu b9b0f9065e Backed out 4 changesets (bug 1842798) for wpt failures on module-tla-import.html . CLOSED TREE
Backed out changeset 879154594bb1 (bug 1842798)
Backed out changeset 2a6b3ff79a01 (bug 1842798)
Backed out changeset 507da9d36f91 (bug 1842798)
Backed out changeset 3528d70acb5f (bug 1842798)
2023-08-02 20:48:53 +03:00
Jon Coppeard f8f59b4727 Bug 1842798 - Part 2: Remove use of MozPromise to wait for module imports to load r=smaug
This replaces the use of a promise to wait for all imports of a module to load
with a counter of reminaing imports in the parent and a pointer to the parent
that is waiting in the child. The parent request is updated immediately rather
than by dispatching a runnable.

Differential Revision: https://phabricator.services.mozilla.com/D183273
2023-08-02 14:39:33 +00:00
Sandor Molnar ea8edefbe1 Backed out 4 changesets (bug 1842798) for causing wpt failures in /html/webappapis/dynamic-markup-insertion/document-write/module-dynamic-import.html CLOSED TREE
Backed out changeset b153ebf104ef (bug 1842798)
Backed out changeset 05bcaff61b68 (bug 1842798)
Backed out changeset 0864a23409e6 (bug 1842798)
Backed out changeset 98a1aa86513d (bug 1842798)
2023-08-02 14:58:13 +03:00
Jon Coppeard 06ecc4c674 Bug 1842798 - Part 2: Remove use of MozPromise to wait for module imports to load r=smaug
This replaces the use of a promise to wait for all imports of a module to load
with a counter of reminaing imports in the parent and a pointer to the parent
that is waiting in the child. The parent request is updated immediately rather
than by dispatching a runnable.

Differential Revision: https://phabricator.services.mozilla.com/D183273
2023-08-02 09:34:39 +00:00
Natalia Csoregi 1f4dc5c852 Backed out 6 changesets (bug 1842798) for causing failures on js/src/tests/test262/language/*. CLOSED TREE
Backed out changeset 38669a2ddad9 (bug 1842798)
Backed out changeset 5dad4aeacd53 (bug 1842798)
Backed out changeset 23d10eb8f853 (bug 1842798)
Backed out changeset 946e4dfe5452 (bug 1842798)
Backed out changeset 1b89736a463f (bug 1842798)
Backed out changeset b2e6bdd781ac (bug 1842798)
2023-07-17 20:52:18 +03:00
Jon Coppeard dd9d0a3ed7 Bug 1842798 - Part 2: Remove use of MozPromise to wait for module imports to load r=smaug
This replaces the use of a promise to wait for all imports of a module to load
with a counter of reminaing imports in the parent and a pointer to the parent
that is waiting in the child. The parent request is updated immediately rather
than by dispatching a runnable.

Differential Revision: https://phabricator.services.mozilla.com/D183273
2023-07-17 12:44:18 +00:00
Jon Coppeard b291f06d03 Bug 1822717 - Relax assertion about module request state when an error occurs r=yulia
ModuleErrored() can be called when we are in the compiling state too, if we are
parsing the module off-thread.

Differential Revision: https://phabricator.services.mozilla.com/D173160
2023-03-21 15:40:22 +00:00
Jon Coppeard cc6ddbdd0f Bug 1813494 - Part 3: Add more cancellation checks and state assertions to module load requests r=smaug
We should check for previous cancellation on all path where a module load
request's state can be changed by an asynchronous action. Also add assertions
about the expected previous state where possible.

Differential Revision: https://phabricator.services.mozilla.com/D168233
2023-02-07 11:55:51 +00:00
Jon Coppeard 1952f4725c Bug 1813494 - Part 2: Add IsErrored() predicate for module load request r=smaug
This condition is checked in a few places.

Differential Revision: https://phabricator.services.mozilla.com/D168232
2023-02-07 11:55:51 +00:00
Jon Coppeard 2a21ae3158 Bug 1811939 - Check whether module load request was already cancelled when a load fails r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167927
2023-01-27 17:19:57 +00:00
Peter Van der Beken 665ba14f94 Bug 1811238 - Correct QueryInterface implementation of LoadedScript and ModuleLoaderBase. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D167252
2023-01-24 09:55:27 +00:00
Olli Pettay 048bd344c4 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Jon Coppeard af3cf7bcba Bug 1766274 - Part 2: Rename ProcessLoadedModuleTree to OnModuleLoadComplete r=yulia
Depends on D144596

Differential Revision: https://phabricator.services.mozilla.com/D144597
2022-04-26 12:40:47 +00:00
Yulia Startsev 3a2268ee6b Bug 1763372 - address new issues in the hybrid build; r=jonco
Depends on D143036

Differential Revision: https://phabricator.services.mozilla.com/D143068
2022-04-22 13:24:10 +00:00
Jon Coppeard 2a22044473 Bug 1761938 - Part 6: Remove global from script load context r=smaug,yulia
This removes the global object field from the script load context and gets the
global from the script loader / module loader where necessary.

Differential Revision: https://phabricator.services.mozilla.com/D142833
2022-04-11 15:35:30 +00:00
Jon Coppeard 9847491365 Bug 1761938 - Part 3: Remove global from the module map key and use URI only r=yulia
Since content scripts have separate module loaders there's no need to key the
module map on the global any more.

Differential Revision: https://phabricator.services.mozilla.com/D142830
2022-04-11 15:35:29 +00:00
Jon Coppeard 94bff9357d Bug 1761938 - Part 1: Call into the module loader via the module load request object r=yulia
The script loader will need to deal with requests from more than one module
loader so this adds methods to the request which dispatch to the correct
loader.

Differential Revision: https://phabricator.services.mozilla.com/D142828
2022-04-11 15:35:28 +00:00