Commit Graph
145 Commits
Author SHA1 Message Date
agoloman c75e2e420f Revert "Bug 2020707, Bug 2020704 - Part 6: Update test expectations now that speculationrules scripts are supported. r=dom-core-reviewers,jjaschke" for causing bc failures @browser_misused_characters_in_strings.js.
This reverts commit 524a1fc191.

Revert "Bug 2020707 - Part 5: Gate speculation rules script support behind a pref. r=dom-core-reviewers,jjaschke"

This reverts commit 11741d18ad.

Revert "Bug 2020707 - Part 4: Unregister speculation rules when their script element is removed. r=dom-core-reviewers,hsivonen"

This reverts commit 5202943dc9.

Revert "Bug 2020707 - Part 3: Report an exception if speculation rules parsing fails. r=dom-core-reviewers,jjaschke"

This reverts commit 70c5aa5425.

Revert "Bug 2020707 - Part 2: Add support for speculationrules script type. r=dom-core-reviewers,jjaschke"

This reverts commit 65b30a350b.

Revert "Bug 2020707 - Part 1: Allow speculation rules to be registered to the document from scripts. r=hsivonen,jjaschke"

This reverts commit 28c7050de9.

Revert "Bug 2020704 - Part 2: Add parser for speculation rule sets. r=hsivonen,jjaschke"

This reverts commit eabb8c6eb3.

Revert "Bug 2020704 - Part 1: Add speculation rules crate. r=dom-core-reviewers,jjaschke"

This reverts commit cd65bed005.
2026-06-12 06:28:05 +00:00
Adam Vandolder 65b30a350b Bug 2020707 - Part 2: Add support for speculationrules script type. r=dom-core-reviewers,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D286178
2026-06-12 04:48:27 +00:00
Mike Hommey 2e89ec09a3 Bug 2008326 - Silence unnecessary-virtual-specifier warnings. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D277742
2026-05-19 04:36:29 +00:00
Tooru Fujisawa 2036a60d85 Bug 2036849 - Part 9: Update the LoadedScript fields usage comment. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299927
2026-05-13 17:10:00 +00:00
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 399c7971ed Bug 2036849 - Part 7: Eagerly clear more response data. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299925
2026-05-13 17:09:53 +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 bb7694d2af Bug 2036849 - Part 4: Remove LoadedScript::OnceCachedStencil. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299922
2026-05-13 17:09:41 +00:00
Tooru Fujisawa 97c4c82770 Bug 2036849 - Part 1: Remove unused LoadedScriptDelegate methods. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299919
2026-05-13 17:09:29 +00:00
Tooru Fujisawa c302546e07 Bug 2038694 - Part 3: Make LoadedScript not-cycle-collected. r=nbp
LoadedScript has been cycle-collected only to allow ModuleScript being
cycle-collected.
Given that ModuleScript is no longer its subclass, LoadedScript doesn't have
to be cycle-collectated.

Differential Revision: https://phabricator.services.mozilla.com/D299918
2026-05-13 15:59:10 +00:00
Tooru Fujisawa 888e37eb21 Bug 2038694 - Part 2: Remove unnecessary subclasses of LoadedScript. r=nbp
All LoadedScript subclasses has no extra fields, and also no ScriptKind-specific
consumers.
Just using LoadedScript class everywhere is sufficient.

Differential Revision: https://phabricator.services.mozilla.com/D299917
2026-05-13 15:59:07 +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
Tooru Fujisawa 036a7339ad Bug 2036190 - Convert ModuleScript to LoadedScript before caching. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D297797
2026-05-04 18:20:22 +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 62a0b4c831 Bug 2031074 - Remove nsIMemoryReporter interface from LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D295199
2026-04-26 10:07:39 +00:00
Tooru Fujisawa 14b3e5d09b Bug 2033379 - Part 1: Remove EventScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D295235
2026-04-26 10:07:32 +00:00
Cosmin Sabou 1bce27241f Revert "Bug 2033379, Bug 2031074 - Remove nsIMemoryReporter interface from LoadedScript. r=nbp" for causing build bustages on ImportMap.cpp
This reverts commit f2463cd050.

Revert "Bug 2033379 - Part 2: Add ScriptKind document. r=nbp"

This reverts commit c947be415d.

Revert "Bug 2033379 - Part 1: Remove EventScript. r=nbp"

This reverts commit 4eddb4c65f.
2026-04-25 19:03:51 +00:00
Tooru Fujisawa f2463cd050 Bug 2031074 - Remove nsIMemoryReporter interface from LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D295199
2026-04-25 18:33:06 +00:00
Tooru Fujisawa 4eddb4c65f Bug 2033379 - Part 1: Remove EventScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D295235
2026-04-25 18:32:58 +00:00
Tooru Fujisawa c05d81a70a Bug 2031077 - Part 4: Add invalidated cache state for LoadedScript. r=bthrall
On memory pressure, the stencil held only for the cache should be released.
In that situation, the LoadedScript instances can still be held by
ScriptLoadRequest etc, and thus the LoadedScript instance itself should be kept
alive, while the stencil pointer being released.

Differential Revision: https://phabricator.services.mozilla.com/D294601
2026-04-25 04:54:34 +00:00
Tooru Fujisawa 7e75539d07 Bug 2031077 - Part 3: Repurpose LoadedScript::mStencil only for the cached case. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294600
2026-04-25 04:54:31 +00:00
Tooru Fujisawa c015fa524d Bug 2031077 - Part 2: Add ScriptLoadRequest::mStencil field to hold the stencil until the instantiation. r=bthrall
In order to clarify the ownership and the expected lifetime,
the stencil should be held by the ScriptLoadRequest, until it's instantiated.

The later patch will remove LoadedScript::mStencil for non-cached case.

Differential Revision: https://phabricator.services.mozilla.com/D294599
2026-04-25 04:54:27 +00:00
Tooru Fujisawa dfc61e3c96 Bug 2031200 - Part 12: Remove ModuleScript::mForPreload. r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D295268
2026-04-22 04:12:47 +00:00
Tooru Fujisawa edcea6935f Bug 2031200 - Part 11: Repurpose LoadedScript::mReferrerPolicy for the cached case. r=bthrall
Same as base URL, the mReferrerPolicy reflects the server response, and it
need to be retained for the cached case.
The existing consumers use the ScriptFetchInfo field.

Differential Revision: https://phabricator.services.mozilla.com/D294343
2026-04-22 04:12:44 +00:00
Tooru Fujisawa bd431250d5 Bug 2031200 - Part 10: Repurpose LoadedScript::mBaseURL for the cached case. r=bthrall
The existing consumers of the base URL now use the
ScriptFetchInfo::mBaseURL, and then the LoadedScript::mBaseURL
is renmaed to LoadedScript::mCachedBaseURL, used only by cached stencil case,
to retain the server responses for the subsequent requests.

Differential Revision: https://phabricator.services.mozilla.com/D294342
2026-04-22 04:12:40 +00:00
Tooru Fujisawa 60050df3f8 Bug 2031200 - Part 9: Add ScriptLoadRequest::FetchOptions() accessor and remove LoadedScript::mFetchOptions. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294341
2026-04-22 04:12:37 +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 3fbbad3664 Bug 2031200 - Part 5: Sync ModuleScript::mForPreload and ScriptFetchInfo::mIsForModulePreload. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294337
2026-04-22 04:12:23 +00:00
Tooru Fujisawa 6951bb5756 Bug 2031200 - Part 4: Sync LoadedScript::mBaseURL and ScriptFetchInfo::mBaseURL. r=bthrall,dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D294336
2026-04-22 04:12:19 +00:00
Tooru Fujisawa 8b3885c09a Bug 2031200 - Part 3: Sync LoadedScript::mReferrerPolicy and ScriptFetchInfo::mReferrerPolicy. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294335
2026-04-22 04:12:16 +00:00
Tooru Fujisawa 0665704082 Bug 2031200 - Part 1: Add ScriptFetchInfo class and ScriptLoadRequest::mFetchInfo field. r=bthrall
ScriptFetchInfo will replace the overlapping LoadedScript fields
and then it will be used for the script/module private, to propagate the
information to the imported modules, without holding the other LoadedScript
fields, especially the response body and the compiled stencil.

Differential Revision: https://phabricator.services.mozilla.com/D294333
2026-04-22 04:12:09 +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 260ad06a2e Bug 2031200 - Part 12: Remove ModuleScript::mForPreload. r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D295268
2026-04-21 15:58:17 +00:00
Tooru Fujisawa cedffcba4e Bug 2031200 - Part 11: Repurpose LoadedScript::mReferrerPolicy for the cached case. r=bthrall
Same as base URL, the mReferrerPolicy reflects the server response, and it
need to be retained for the cached case.
The existing consumers use the ScriptFetchInfo field.

Differential Revision: https://phabricator.services.mozilla.com/D294343
2026-04-21 15:58:13 +00:00
Tooru Fujisawa a4fd83ce4d Bug 2031200 - Part 10: Repurpose LoadedScript::mBaseURL for the cached case. r=bthrall
The existing consumers of the base URL now use the
ScriptFetchInfo::mBaseURL, and then the LoadedScript::mBaseURL
is renmaed to LoadedScript::mCachedBaseURL, used only by cached stencil case,
to retain the server responses for the subsequent requests.

Differential Revision: https://phabricator.services.mozilla.com/D294342
2026-04-21 15:58:10 +00:00
Tooru Fujisawa 66bc9492b3 Bug 2031200 - Part 9: Add ScriptLoadRequest::FetchOptions() accessor and remove LoadedScript::mFetchOptions. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294341
2026-04-21 15:58:06 +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 0f69b1fb94 Bug 2031200 - Part 5: Sync ModuleScript::mForPreload and ScriptFetchInfo::mIsForModulePreload. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294337
2026-04-21 15:57:52 +00:00
Tooru Fujisawa 472f447c9e Bug 2031200 - Part 4: Sync LoadedScript::mBaseURL and ScriptFetchInfo::mBaseURL. r=bthrall,dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D294336
2026-04-21 15:57:48 +00:00
Tooru Fujisawa b5410280f5 Bug 2031200 - Part 3: Sync LoadedScript::mReferrerPolicy and ScriptFetchInfo::mReferrerPolicy. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294335
2026-04-21 15:57:45 +00:00
Tooru Fujisawa fc8d3b6c48 Bug 2031200 - Part 1: Add ScriptFetchInfo class and ScriptLoadRequest::mFetchInfo field. r=bthrall
ScriptFetchInfo will replace the overlapping LoadedScript fields
and then it will be used for the script/module private, to propagate the
information to the imported modules, without holding the other LoadedScript
fields, especially the response body and the compiled stencil.

Differential Revision: https://phabricator.services.mozilla.com/D294333
2026-04-21 15:57:38 +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
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
Tooru Fujisawa d70f1f6c0e Bug 2019337 - Part 4: Collect ref count telemetry for cached LoadedScript. r=nbp,denispal
Differential Revision: https://phabricator.services.mozilla.com/D285183
2026-03-06 08:28:57 +00:00
Tooru Fujisawa 3133642cd0 Bug 2019337 - Part 3: Collect per-process SharedScriptCache usage telemetry. r=nbp,denispal
Differential Revision: https://phabricator.services.mozilla.com/D285647
2026-03-06 08:28:54 +00:00
Tooru Fujisawa 39a8e3b5bd Bug 2020958 - Use the correct fetch option when nonce is different than the cached one. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D286010
2026-03-05 08:21:06 +00:00
Yoshi Cheng-Hao Huang cb89c5ad77 Bug 1916277 - Part 12: Add ModuleScript::ResetPreload. r=jonco
Reset modules information happened during preload.

Differential Revision: https://phabricator.services.mozilla.com/D278656
2026-03-03 00:52:54 +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
Tooru Fujisawa 212aac6e6c Bug 2017052 - Part 2: Put SRIMetadata into LoadedScript. r=nbp
This makes the SRIMetadata for the first request a part of LoadedScript,
with defaulting to a nullptr for empty SRIMetadata.

The next patch will remove SRIMetadata from ScriptCacheKey, which allows
reducing the size of the cache when SRIMetadata is not given.

Differential Revision: https://phabricator.services.mozilla.com/D283541
2026-02-24 02:24:24 +00:00