Commit Graph
379 Commits
Author SHA1 Message Date
Tooru Fujisawa b1578b8a63 Bug 2036849 - Part 8: Rewrite the IsTextSource and IsSerializedStencil accessors for the ScriptLoadRequest to avoid accidental use after converting to cache. r=nbp,dom-worker-reviewers,asuth
LoadedScript::{IsTextSource,IsSerializedStencil} accessors can return
false once it's converted to cache.
Most of the consumers need the flag to branch on the server response, before
converting to cache.
Add assertions to avoid accidental use.

Differential Revision: https://phabricator.services.mozilla.com/D299926
2026-05-13 17:09:56 +00:00
Tooru Fujisawa 2d1b0d7a84 Bug 2036849 - Part 6: Directly use LoadedScript to clear the non-cached response. r=nbp
The subsequent patches will restrict the ScriptLoadRequest's IsTextSource and
IsSerializedStencil accessors usage, so that they can be used only before
they're converted to cached stencil.

This patch rewrites their consumer after that point to directly use the
underlying LoadedScript accessors and methods.

Differential Revision: https://phabricator.services.mozilla.com/D299924
2026-05-13 17:09:49 +00:00
Tooru Fujisawa 5026dda743 Bug 2036849 - Part 3: Use ScriptLoadRequest::IsRetrievedFromMemoryCache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299921
2026-05-13 17:09:37 +00:00
Tooru Fujisawa a917470f06 Bug 2038694 - Part 1: Make ModuleScript a separate class than LoadedScript. r=nbp,allstarschh
ModuleScript is used only as the place to hold the compilation and evaluation
result of modules, and it's no longer necessary to be a LoadedScript subclass.

This makes all LoadedScript instances GC-free, and the module's LoadedScript
(temporailry renamed to LoadedModuleScript) can directly be stored into the
SharedScriptCache.

The subsequent patches will cleanup the LoadedScript, its subclasses, and
their consumers.

Differential Revision: https://phabricator.services.mozilla.com/D299916
2026-05-13 15:59:02 +00:00
Daniel Minor c06fd391ed Bug 1997621 - Don't cache wasm modules in ModuleLoaderBase; r=arai
Differential Revision: https://phabricator.services.mozilla.com/D297111
2026-05-12 21:08:12 +00:00
Norisz Fay 712f2f9edd Revert "Bug 1997621 - Update esm-integration wpt expectations; r=arai" for causing SM bustages @ import-source-static.js
This reverts commit 8435ccfec7.

Revert "Bug 1997621 - Change prefs from "startup" to "always"; r=arai"

This reverts commit 19b31608e1.

Revert "Bug 1997621 - Support source phase wasm modules in loaders; r=arai,dom-worker-reviewers,edenchuang"

This reverts commit b8b734ea4b.

Revert "Bug 1997621 - Allow workers to retrieve wasm modules; r=necko-reviewers,arai,valentin"

This reverts commit a623893c43.

Revert "Bug 1997621 - Prevent evaluation phase after source phase import; r=arai"

This reverts commit 941767f9ef.

Revert "Bug 1997621 - Don't cache wasm modules in ModuleLoaderBase; r=arai"

This reverts commit 953057b81b.

Revert "Bug 1997621 - Add ModuleRequestIsSourcePhase; r=arai"

This reverts commit 70e6b7479b.

Revert "Bug 1997621 - Support wasm modules in the shell; r=arai"

This reverts commit fd03655ae8.

Revert "Bug 1997621 - Use wasm module for test262 "<module source>"; r=arai"

This reverts commit 29ab548ec9.

Revert "Bug 1997621 - Implement JS::CompileWasmModuleAsSource; r=arai"

This reverts commit 01acf41334.

Revert "Bug 1997621 - Store Objects in ModuleSourceSlot; r=arai"

This reverts commit a60cf7949a.

Revert "Bug 1997621 - Add ModuleObject::createWasmEnvironment; r=arai"

This reverts commit 8894435bd0.

Revert "Bug 1997621 - Add ScriptSourceObject::createForWasmModule; r=arai"

This reverts commit fe8a2fad38.

Revert "Bug 1997621 - Add wasm::CompileForESM; r=rhunt"

This reverts commit 51a048d461.

Revert "Bug 1997621 - Make WebAssembly.Module inherit from AbstractModuleSource; r=rhunt"

This reverts commit 9b7b168843.
2026-05-12 00:39:14 +00:00
Daniel Minor 953057b81b Bug 1997621 - Don't cache wasm modules in ModuleLoaderBase; r=arai
Differential Revision: https://phabricator.services.mozilla.com/D297111
2026-05-11 23:54:25 +00:00
Tooru Fujisawa 32c2970f79 Bug 2036042 - Handle invalidated cached stencil also as cached case. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D297796
2026-05-04 18:20:20 +00:00
Tooru Fujisawa 83c3d50d82 Bug 2031200 - Part 7: Use ScriptFetchInfo for the script private and module private instead of LoadedScript. r=bthrall,allstarschh,dom-worker-reviewers,asuth
Replace the all places that stores and uses the script/module private to use
ScriptFetchInfo instead of LoadedScript/ModuleScript, so that the
LoadedScript/ModuleScript can be released earlier.

Differential Revision: https://phabricator.services.mozilla.com/D294339
2026-04-22 04:12:30 +00:00
Tooru Fujisawa f5b37d0d22 Bug 2031200 - Part 2: Remove obsolete code to sync the exact same field. r=bthrall
ScriptLoadRequest::ReferrerPolicy is backed by LoadedScript::mReferrerPolicy,
and the code is comparing the same field.

Differential Revision: https://phabricator.services.mozilla.com/D294334
2026-04-22 04:12:12 +00:00
Alexandru Marc bcdf79e032 Revert "Bug 2031200 - Part 12: Remove ModuleScript::mForPreload. r=allstarschh" for causing hazard bustages @ ModuleLoaderBase
This reverts commit 260ad06a2e.

Revert "Bug 2031200 - Part 11: Repurpose LoadedScript::mReferrerPolicy for the cached case. r=bthrall"

This reverts commit cedffcba4e.

Revert "Bug 2031200 - Part 10: Repurpose LoadedScript::mBaseURL for the cached case. r=bthrall"

This reverts commit a4fd83ce4d.

Revert "Bug 2031200 - Part 9: Add ScriptLoadRequest::FetchOptions() accessor and remove LoadedScript::mFetchOptions. r=bthrall"

This reverts commit 66bc9492b3.

Revert "Bug 2031200 - Part 8: Remove ScriptHashKey constructor with LoadedScript. r=bthrall"

This reverts commit 5bb4928c8f.

Revert "Bug 2031200 - Part 7: Use ScriptFetchInfo for the script private and module private instead of LoadedScript. r=bthrall,allstarschh,dom-worker-reviewers,asuth"

This reverts commit 0011dfbdcc.

Revert "Bug 2031200 - Part 6: Do not pass private value to JS::UpdateDebugMetadata. r=bthrall"

This reverts commit 0e8a2f1032.

Revert "Bug 2031200 - Part 5: Sync ModuleScript::mForPreload and ScriptFetchInfo::mIsForModulePreload. r=bthrall"

This reverts commit 0f69b1fb94.

Revert "Bug 2031200 - Part 4: Sync LoadedScript::mBaseURL and ScriptFetchInfo::mBaseURL. r=bthrall,dom-worker-reviewers,asuth"

This reverts commit 472f447c9e.

Revert "Bug 2031200 - Part 3: Sync LoadedScript::mReferrerPolicy and ScriptFetchInfo::mReferrerPolicy. r=bthrall"

This reverts commit b5410280f5.

Revert "Bug 2031200 - Part 2: Remove obsolete code to sync the exact same field. r=bthrall"

This reverts commit 2b784b6e6f.

Revert "Bug 2031200 - Part 1: Add ScriptFetchInfo class and ScriptLoadRequest::mFetchInfo field. r=bthrall"

This reverts commit fc8d3b6c48.
2026-04-21 21:28:08 +00:00
Tooru Fujisawa 0011dfbdcc Bug 2031200 - Part 7: Use ScriptFetchInfo for the script private and module private instead of LoadedScript. r=bthrall,allstarschh,dom-worker-reviewers,asuth
Replace the all places that stores and uses the script/module private to use
ScriptFetchInfo instead of LoadedScript/ModuleScript, so that the
LoadedScript/ModuleScript can be released earlier.

Differential Revision: https://phabricator.services.mozilla.com/D294339
2026-04-21 15:57:59 +00:00
Tooru Fujisawa 2b784b6e6f Bug 2031200 - Part 2: Remove obsolete code to sync the exact same field. r=bthrall
ScriptLoadRequest::ReferrerPolicy is backed by LoadedScript::mReferrerPolicy,
and the code is comparing the same field.

Differential Revision: https://phabricator.services.mozilla.com/D294334
2026-04-21 15:57:41 +00:00
Tooru Fujisawa 607f48b4b6 Bug 2031614 - Use LoadedScript::mURI instead of LoadedScript::mBaseURL in Cu.loadedESModules. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294116
2026-04-15 03:29:39 +00:00
Tooru Fujisawa ebd63c667c Bug 2031573 - Pass the module record instead of the module private to the ModuleMetadataHook. r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D294105
2026-04-14 15:26:54 +00:00
Sylvestre Ledru d2b4f9d727 Bug 2023419 - Remove Emacs/Vim modelines from js/ r=emilio,nbp
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287851
2026-04-03 07:40:15 +00:00
Yoshi Cheng-Hao Huang 519cd1caab Bug 2027541 - Patch. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D291467
2026-04-02 19:36:22 +00:00
Emilio Cobos Álvarez 5016086e1a Bug 2025089 - Remove some includes from nsINode.h and Element.h. r=dom-core,dom-storage-reviewers,firefox-svg-reviewers,janv,smaug
Differential Revision: https://phabricator.services.mozilla.com/D289049
2026-03-22 23:45:55 +00:00
Alexandru Marc c565130f5c Revert "Bug 2023419 - Remove Emacs/Vim modelines from js/ r=emilio,nbp" for causing SM bustages @ Debugger-findScripts-12.js
This reverts commit 631e966bff.
2026-03-17 16:04:32 +00:00
Sylvestre Ledru 631e966bff Bug 2023419 - Remove Emacs/Vim modelines from js/ r=emilio,nbp
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287851
2026-03-17 15:44:27 +00:00
Yoshi Cheng-Hao Huang 4545802714 Bug 1916277 - Part 14: Fetching/Fetched module maps update. r=jonco
Cancel preloading requests, regardless the pref is on or off.

When the pref is on (multiple import maps is enabled), mFetchedModules
may contain module scripts that have been fetched during normal loading,
therefore we don't update it.

Differential Revision: https://phabricator.services.mozilla.com/D275179
2026-03-03 00:52:58 +00:00
Yoshi Cheng-Hao Huang 2ed834694e Bug 1916277 - Part 13: Reset preloaded module graphs before registering an import map. r=jonco
When registering an import map, we must remove any preloaded scripts
because their resolved URLs may no longer be valid under the new import
map.

Differential Revision: https://phabricator.services.mozilla.com/D272783
2026-03-03 00:52:56 +00:00
Yoshi Cheng-Hao Huang f10f564f7b Bug 1916277 - Part 11: Add preloaded specifiers into global's resolved set. r=jonco
When the preloaded request is reused during parsing, merge the preloaded
resolved module set into the global resolved module set to ensure consistency.

Differential Revision: https://phabricator.services.mozilla.com/D275178
2026-03-03 00:52:52 +00:00
Yoshi Cheng-Hao Huang 8377cfe15c Bug 1916277 - Part 10: Add a debug slot [[IsPreload]] in ModuleObject. r=jonco
This will allow us to identify the module is loaded during preloading
phase.

Differential Revision: https://phabricator.services.mozilla.com/D281155
2026-03-03 00:52:49 +00:00
Yoshi Cheng-Hao Huang 14a186766a Bug 1916277 - Part 9: Store Preloaded resolved set in the root moduleScript. r=jonco
Allocate a ResolvedModuleSet in the top-level preloading module script, and
use the `aHostDefined` parameter in HostLoadImportedModule to get the
corresponding preloaded ResolvedModuleSet.

Differential Revision: https://phabricator.services.mozilla.com/D272782
2026-03-03 00:52:47 +00:00
Yoshi Cheng-Hao Huang 2e020fb841 Bug 1916277 - Part 7: Implement ImportMap::Merge. r=jonco,flod
Implement https://html.spec.whatwg.org/#merge-existing-and-new-import-maps

Differential Revision: https://phabricator.services.mozilla.com/D272781
2026-03-03 00:52:43 +00:00
Yoshi Cheng-Hao Huang b267594cfd Bug 1916277 - Part 6: Implement AddToResolvedModuleSet to complete the 'resolve a module specifier' per spec. r=jonco
The addition is performed after resolution so that resolved specifiers
can be processed more easily, particularly for preload requests. This
change also refactors the return value of ResolvedModuleSpecifier to use
a SpecifierResolutionRecord instead.

Differential Revision: https://phabricator.services.mozilla.com/D272779
2026-03-03 00:52:40 +00:00
Yoshi Cheng-Hao Huang ada725c0a3 Bug 1916277 - Part 5: Update RegisterImportMap. r=jonco
Add a request parameter to construct the ReportWarningHelper.

Differential Revision: https://phabricator.services.mozilla.com/D272780
2026-03-03 00:52:38 +00:00
Tooru Fujisawa bf1873b928 Bug 2019262 - Propagate the error status of the modules from/to SyncModuleLoader, to avoid importing single module twice even for error case. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D285311
2026-03-02 14:02:03 +00:00
Matthew Gaudet 0b02c4cf28 Bug 2010911 - Cleanup PromiseJobRunnable r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D279353
2026-01-19 16:09:09 +00:00
Tooru Fujisawa 2613218569 Bug 2002199 - Part 4: Remove LoadedScriptDelegate::ClearScriptSource. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D273971
2025-12-02 01:28:17 +00:00
Tooru Fujisawa fb06302042 Bug 1907011 - Part 7: Update the most of the remaining usage of "bytecode" and update document. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273960
2025-11-26 04:13:26 +00:00
Harveer Singh 19e9ef1bce Bug 1995558: Service worker module registration should be rejected in case of any evaluation errors.r=edenchuang,dom-worker-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D269457
2025-11-14 15:55:52 +00:00
Lando ce8566cc91 Merge mozilla-central to autoland 2025-11-05 10:33:44 +00:00
Narcis Beleuzu 88121de0cc Revert "Bug 1360870, 1989386, 1990925, 1995558: apply code formatting via Lando" for causing the macOS top crash in Bug 1998332
This reverts commit fdacf289d5.

This reverts commit 5f838f6b5a.

This reverts commit a9ff68075f.

This reverts commit 92013428c4.

This reverts commit 62795c77d7.

This reverts commit 9e90e5f01e.

This reverts commit f8438fb258.

This reverts commit f7f43476a2.
2025-11-05 10:27:55 +00:00
Tooru Fujisawa 4a904c5804 Bug 1973221 - Part 1: Support disk cache for dynamic import. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D271030
2025-11-05 04:12:21 +00:00
Harveer Singh a9ff68075f Bug 1995558: Service worker module registration should be rejected in case of any evaluation errors.r=edenchuang,dom-worker-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D269457
2025-11-04 01:23:53 +00:00
Cristina Horotan 3880a52dfd Revert "Bug 1360870, Bug 1989386, Bug 1990925, Bug 1995558: Test changes.r=edenchuang,dom-worker-reviewers" for causing dt failures on browser_webconsole_json_mime.js
This reverts commit 7604e737be.

Revert "Bug 1995558: Service worker module registration should be rejected in case of any evaluation errors.r=edenchuang,dom-worker-reviewers"

This reverts commit ac602ed98c.

Revert "Bug 1990925: Module service workers should be able to load json modules.r=edenchuang,dom-worker-reviewers"

This reverts commit dc6f670880.

Revert "Bug 1989386: Correctly update serviceworker type on re-registration.r=edenchuang,dom-worker-reviewers"

This reverts commit bd63d6b6d0.

Revert "Bug 1360870: on-disk schema changes to persist new serviceworker type parameter.r=edenchuang,dom-worker-reviewers"

This reverts commit 9f740083c9.

Revert "Bug 1360870: Some source code plumbing and refactorings to support new serviceworker type.r=edenchuang,dom-worker-reviewers"

This reverts commit e813c3de2f.

Revert "Bug 1360870: idl changes to support module service workers.r=asuth,edenchuang,webidl,smaug,dom-worker-reviewers"

This reverts commit 2b4f2ed60e.
2025-11-03 01:32:20 +00:00
Harveer Singh ac602ed98c Bug 1995558: Service worker module registration should be rejected in case of any evaluation errors.r=edenchuang,dom-worker-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D269457
2025-11-02 14:16:16 +00:00
Tooru Fujisawa b1c9db5a25 Bug 1996160 - Part 1: Use observer notifications for ScriptLoader tests. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270110
2025-10-29 23:32:13 +00:00
Atila Butkovits 285b305de4 Revert "Bug 1360870, Bug 1995558, Bug 1990925, Bug 1989386: Test changes.r=edenchuang,dom-worker-reviewers" for causing failures at browser_dbg-browser-toolbox-workers.js.
This reverts commit 5308d85d13.

Revert "Bug 1995558: Service worker module registration should be rejected in case of any evaluation errors.r=edenchuang,dom-worker-reviewers"

This reverts commit 262e9c7f22.

Revert "Bug 1990925: Module service workers should be able to load json modules.r=edenchuang,dom-worker-reviewers"

This reverts commit 5e00fd86aa.

Revert "Bug 1989386: Correctly update serviceworker type on re-registration.r=edenchuang,dom-worker-reviewers"

This reverts commit 137e22f440.

Revert "Bug 1360870: on-disk schema changes to persist new serviceworker type parameter.r=edenchuang,dom-worker-reviewers"

This reverts commit bf551670f4.

Revert "Bug 1360870: Some source code plumbing and refactorings to support new serviceworker type.r=edenchuang,dom-worker-reviewers"

This reverts commit 040663a23b.

Revert "Bug 1360870: idl changes to support module service workers.r=asuth,edenchuang,webidl,smaug,dom-worker-reviewers"

This reverts commit c8854f0a27.
2025-10-29 22:04:28 +00:00
Harveer Singh 262e9c7f22 Bug 1995558: Service worker module registration should be rejected in case of any evaluation errors.r=edenchuang,dom-worker-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D269457
2025-10-29 20:34:08 +00:00
Yoshi Cheng-Hao Huang 444f24047f Bug 1968885 - Part 2: Remove ResolveRequestedModules. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D269567
2025-10-23 08:50:12 +00:00
Yoshi Cheng-Hao Huang 3d14ba2824 Bug 1968885 - Part 1: Pass lineNo and columnNo to HostLoadImportedModule. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D269566
2025-10-23 08:50:10 +00:00
Tooru Fujisawa 32c285e820 Bug 1992341 - Part 6: Update the method names and comments. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D269523
2025-10-23 04:19:20 +00:00
Tooru Fujisawa 3cab1a6f1a Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang
In contrast to other fields, mBaseURL is not populated in the constructors.
Thus we just need to remove the ScriptLoadRequest::mBaseURL field and
use the LoadedScript::mBaseURL instead.

Differential Revision: https://phabricator.services.mozilla.com/D267360
2025-10-22 11:21:01 +00:00
Tooru Fujisawa cde6c638b3 Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267359
2025-10-22 11:20:59 +00:00
Tooru Fujisawa 9cd82d3aa1 Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267357
2025-10-22 11:20:53 +00:00
Atila Butkovits 13ff5f1bad Revert "Bug 1991607 - Part 12: Reorder ScriptLoadRequest/ModuleLoadRequest fields. r=bthrall" for causing bustages at LoadedScript.cpp.
This reverts commit 30499d5cdc.

Revert "Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 85324622ab.

Revert "Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 3b1afd5ca0.

Revert "Bug 1991607 - Part 9: Pass URI to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 10dc4e2bc0.

Revert "Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit b4c09eb6e1.

Revert "Bug 1991607 - Part 7: Pass FetchOptions to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit f48d2160e1.

Revert "Bug 1991607 - Part 6: Remove ScriptLoadRequest::mReferrerPolicy. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit a6901c3f1d.

Revert "Bug 1991607 - Part 5: Pass ReferrerPolicy to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit c2b5cb885a.

Revert "Bug 1991607 - Part 4: Add ImportMapScript subclass for LoadedScript. r=bthrall"

This reverts commit 09b8ae44b8.

Revert "Bug 1991607 - Part 3: Make LoadedScript::mKind field const. r=bthrall"

This reverts commit 3eebccc479.

Revert "Bug 1991607 - Part 2: Let ScriptLoader::CheckContentPolicy receive LoadedScript-related parameters separately. r=bthrall"

This reverts commit dd8530cb71.

Revert "Bug 1991607 - Part 1: Let ScriptHashKey and ScriptLoadData receive LoadedScript-related parameters separately. r=bthrall"

This reverts commit b4a4f94096.
2025-10-22 05:40:38 +00:00
Tooru Fujisawa 85324622ab Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang
In contrast to other fields, mBaseURL is not populated in the constructors.
Thus we just need to remove the ScriptLoadRequest::mBaseURL field and
use the LoadedScript::mBaseURL instead.

Differential Revision: https://phabricator.services.mozilla.com/D267360
2025-10-22 04:38:20 +00:00