Commit Graph
102 Commits
Author SHA1 Message Date
Tooru Fujisawa ebec92d70e Bug 1991358 - Part 3: Remove ScriptLoadRequest::MarkScriptForCache and ModuleLoadRequest::MarkModuleForCache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D266620
2025-10-01 09:58:50 +00:00
Tooru Fujisawa f9e1c5eb8c Bug 1991358 - Part 2: Remove ScriptLoadRequest::mScriptForCache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D266619
2025-10-01 09:58:46 +00:00
Tooru Fujisawa a3149ca9dd Bug 1991081 - Part 3: Store nsICacheInfoChannel to LoadedScript also in text and bytecode variants. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D266613
2025-09-30 11:39:14 +00:00
Tooru Fujisawa 9a399e62d6 Bug 1989877 - Part 1: Add ScriptLoadRequest::HasDiskCacheReference and use {HasDiskCacheReference,DropDiskCacheReference} consistently. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D265611
2025-09-25 10:59:58 +00:00
Kelsey Gilbert 351b02d1e2 Bug 1958371 - Reduce header-header-includes of e.g. ScriptLoadRequest.h. r=mccr8,spidermonkey-reviewers,arai
Differential Revision: https://phabricator.services.mozilla.com/D244409
2025-09-09 19:03:45 +00:00
Yoshi Cheng-Hao Huang 630abc20e1 Bug 1968895 - Part 5: Add CreateDefaultScriptFetchOptions and GetClientReferrerURI. r=jonco
Provide virtual interfaces to be overriden by the environment.

Differential Revision: https://phabricator.services.mozilla.com/D263374
2025-09-07 09:03:51 +00:00
Cristina Horotan 1fe1c12f6e Revert "Bug 1968895: apply code formatting via Lando" for causing SM failures on Value.h
This reverts commit 40010a7da7.

Revert "Bug 1968895 - Part 7: Remove StartFetchingModuleAndDependencies. r=jonco"

This reverts commit 816a0a6015.

Revert "Bug 1968895 - Part 6: Replace CreateStaticImport/CreateDynamicImport with CreateRequest. r=jonco"

This reverts commit e29a957535.

Revert "Bug 1968895 - Part 5: Add CreateDefaultScriptFetchOptions and GetClientReferrerURI. r=jonco"

This reverts commit 4b21d41ec1.

Revert "Bug 1968895 - Part 4: Pass null for referrer in shadow realm import value. r=jonco"

This reverts commit a3417dbe89.

Revert "Bug 1968895 - Part 3: Update ModuleLoadRequest's referrer policy for workers. r=jonco"

This reverts commit 6a28639be8.

Revert "Bug 1968895 - Part 2: Pass BaseURL for static/dynamic import. r=jonco"

This reverts commit dab430a7b4.

Revert "Bug 1968895 - Part 1: Check if dynamic import is supported earlier. r=jonco"

This reverts commit 34f67fd697.
2025-09-03 18:44:42 +00:00
Yoshi Cheng-Hao Huang 4b21d41ec1 Bug 1968895 - Part 5: Add CreateDefaultScriptFetchOptions and GetClientReferrerURI. r=jonco
Provide virtual interfaces to be overriden by the environment.

Differential Revision: https://phabricator.services.mozilla.com/D263374
2025-09-03 17:58:49 +00:00
Tooru Fujisawa 772c2d9c97 Bug 1979595 - Reduce ScriptLoadRequest::mSourceMapURL size. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D260915
2025-08-25 05:48:00 +00:00
Tooru Fujisawa ea00d6421a Bug 1977148 - Part 4: Rename bytecode-encoding-related identifiers to cache. r=nbp
There are shared path between "save bytecode" vs "cache stencil".
This patch just renames everything, and the subsequent bugs and patches will
split the flag and methods.

Differential Revision: https://phabricator.services.mozilla.com/D260911
2025-08-25 05:47:45 +00:00
Jon Coppeard cb1544dc98 Bug 1982328 - Part 15: Remove comment referencing function that was removed r=allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D260678
2025-08-13 14:17:21 +00:00
Sylvestre Ledru 8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
Yoshi Cheng-Hao Huang 8f81cf5c44 Bug 1965436 - Remove redundant HoldJSObjects call in ScriptLoadRequest. r=jonco
HoldJSObjects is already called in the ~ScriptLoadRequest. So remove the
redundant one in ScriptLoadRequest::DropBytecodeCacheReferences.

Differential Revision: https://phabricator.services.mozilla.com/D249036
2025-05-13 11:02:55 +00:00
Tooru Fujisawa c882062351 Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 13:09:04 +00:00
Stanca Serban 3d34fe1048 Backed out 8 changesets (bug 1949932) for causing reftests failures in LoadedScript.h. CLOSED TREE
Backed out changeset de39fd08733d (bug 1949932)
Backed out changeset b75281f1b27c (bug 1949932)
Backed out changeset 8920e6d4cf8c (bug 1949932)
Backed out changeset c05f9bf802ae (bug 1949932)
Backed out changeset 2c9718bfd7be (bug 1949932)
Backed out changeset 03f4514cfba8 (bug 1949932)
Backed out changeset 9fe4fd6ee6e8 (bug 1949932)
Backed out changeset 1cebf102e64e (bug 1949932)
2025-04-01 08:59:51 +03:00
Tooru Fujisawa 872eb028b0 Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 03:11:18 +00:00
Goloman Adrian 62c97b0b6c Backed out 8 changesets (bug 1949932) for causing build bustages @RootingAPI.h. CLOSED TREE
Backed out changeset 181cde5d267e (bug 1949932)
Backed out changeset 44fd656c40de (bug 1949932)
Backed out changeset b4d93df0edb1 (bug 1949932)
Backed out changeset 7c20db67f688 (bug 1949932)
Backed out changeset ac742d9dc3aa (bug 1949932)
Backed out changeset 102e0dc46dff (bug 1949932)
Backed out changeset 80d1b3331844 (bug 1949932)
Backed out changeset cc1834c3ea2a (bug 1949932)
2025-04-01 07:09:29 +03:00
Tooru Fujisawa 85a3b6e05a Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 03:11:18 +00:00
Tooru Fujisawa 303abbb5c4 Bug 1954644 - Part 1: Make the cycle collection macro use consistent. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242306
2025-03-22 04:03:54 +00:00
Dave Townsend 941f1ac3b3 Bug 1945566 - Add a moz-src protocol handler, r=necko-reviewers,firefox-desktop-core-reviewers ,extension-reviewers,robwu,mconley,valentin,tschuster
Differential Revision: https://phabricator.services.mozilla.com/D236569
2025-03-03 12:47:46 +00:00
Sandor Molnar 13d09c1f65 Backed out 4 changesets (bug 1945566) for causing build bustages/py3 unit test failures/bugzilla lint failures CLOSED TREE
Backed out changeset 6d69925d57ac (bug 1945566)
Backed out changeset 1b2bd35ca71f (bug 1945566)
Backed out changeset 9eba66d33006 (bug 1945566)
Backed out changeset c19c6833ebdc (bug 1945566)
2025-02-26 14:24:49 +02:00
Dave Townsend 75fc886ee6 Bug 1945566 - Add a moz-src protocol handler, r=necko-reviewers,firefox-desktop-core-reviewers ,extension-reviewers,robwu,mconley,valentin
Differential Revision: https://phabricator.services.mozilla.com/D236569
2025-02-26 11:30:59 +00:00
Tooru Fujisawa adec9d4fda Bug 1907009 - Part 1: Add CacheExpirationTime type. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D217957
2024-08-06 05:38:23 +00:00
Tooru Fujisawa dd9a53aa0d Bug 1896709 - Part 9: Add ScriptLoadRequest::CacheEntryFound. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215878
2024-07-18 21:58:13 +00:00
Tooru Fujisawa c6a331f334 Bug 1896709 - Part 5: Add ScriptLoadRequest::IsCacheable. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215874
2024-07-18 21:58:11 +00:00
Tooru Fujisawa 321fa48d05 Bug 1896709 - Part 2: Add const variant of ScriptLoadRequest::GetScriptLoadContext. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215871
2024-07-18 21:58:10 +00:00
Norisz Fay 471367226c Backed out 17 changesets (bug 1896709) for causing build bustage and mochitest failures CLOSED TREE
Backed out changeset 046f0f522ce7 (bug 1896709)
Backed out changeset 0271e50308e6 (bug 1896709)
Backed out changeset 26fac760de19 (bug 1896709)
Backed out changeset 6fa3424dfc40 (bug 1896709)
Backed out changeset b7bcb9904435 (bug 1896709)
Backed out changeset c6878c5fdde4 (bug 1896709)
Backed out changeset 8ca8a4082e44 (bug 1896709)
Backed out changeset 20ff83806cc6 (bug 1896709)
Backed out changeset 6c9338852a19 (bug 1896709)
Backed out changeset e8615b5d82ab (bug 1896709)
Backed out changeset 842f2047a4bd (bug 1896709)
Backed out changeset 54eea04a7342 (bug 1896709)
Backed out changeset 220b544127cb (bug 1896709)
Backed out changeset 52ce0ebfb29a (bug 1896709)
Backed out changeset 34fc79dc1ad7 (bug 1896709)
Backed out changeset 50b0f6a23e3c (bug 1896709)
Backed out changeset 89c4c6bb465a (bug 1896709)
2024-07-18 14:48:46 +03:00
Tooru Fujisawa 2d77dfea62 Bug 1896709 - Part 9: Add ScriptLoadRequest::CacheEntryFound. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215878
2024-07-18 09:15:26 +00:00
Tooru Fujisawa 500c12673d Bug 1896709 - Part 5: Add ScriptLoadRequest::IsCacheable. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215874
2024-07-18 09:15:25 +00:00
Tooru Fujisawa 8e816052eb Bug 1896709 - Part 2: Add const variant of ScriptLoadRequest::GetScriptLoadContext. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215871
2024-07-18 09:15:24 +00:00
Tooru Fujisawa 599af2d7d2 Bug 1899172 - Part 11: Move nsIScriptElement from ScriptFetchOptions to ScriptLoadContext. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D211912
2024-05-30 05:01:18 +00:00
Tooru Fujisawa 6e5b7d5d1b Bug 1898677 - Cache the result of bytecode encoding condition. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D211517
2024-05-27 06:31:16 +00:00
Tooru Fujisawa ae9c578ace Bug 1803810 - Part 1: Rename ComponentModuleLoader to SyncModuleLoader. r=jonco
The behavior is longer tightly associated with "component".

Differential Revision: https://phabricator.services.mozilla.com/D199453
2024-02-14 02:01:36 +00:00
Cosmin Sabou 6efefaa470 Backed out 10 changesets (bug 1803810) for xpcshell failures on test_import_global. CLOSED TREE
Backed out changeset d5df64b38425 (bug 1803810)
Backed out changeset b8f45cbb5596 (bug 1803810)
Backed out changeset c02d879622bd (bug 1803810)
Backed out changeset 9593275c0195 (bug 1803810)
Backed out changeset 2e2f01296233 (bug 1803810)
Backed out changeset 9699c18e5bf7 (bug 1803810)
Backed out changeset 84cdfd738db6 (bug 1803810)
Backed out changeset 58160b9119ef (bug 1803810)
Backed out changeset 4aa6e036fe7a (bug 1803810)
Backed out changeset 656b61cbd15c (bug 1803810)
2024-02-13 17:41:01 +02:00
Tooru Fujisawa e39b7e1b3d Bug 1803810 - Part 1: Rename ComponentModuleLoader to SyncModuleLoader. r=jonco
The behavior is longer tightly associated with "component".

Differential Revision: https://phabricator.services.mozilla.com/D199453
2024-02-13 14:34:21 +00:00
Tooru Fujisawa e29632369c Bug 1877596 - Use original URL as base URL for internal scheme also in worker. r=jonco,dom-storage-reviewers,janv,dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D200129
2024-02-05 01:12:24 +00:00
Nicolas B. Pierron 8de7851246 Bug 1800641 - Part 12: Move some ScriptLoadRequest fields into LoadedScript. r=nbp
We are looking into caching loaded script in memory. To do so we need something
to cache.

At the moment, the `ScriptLoadRequest` structure hold all the fields which are
loaded, and used before executing JavaScript code. Then, the `ScriptLoadRequest`
is not guaranteed to out-live the first execution.

Therefore, we have to move fields out of the `ScriptLoadRequest` such that they
can later be used by any caching mechanism. The `LoadedScript` is the closest
existing structure which exists which fit the description.

This patch moves fields out of the ScriptLoadRequest into the `LoadedScript`,
which already has a `LoadedScript` field.

The `LoadedScript` field is initialized sooner, when the `ScriptLoadRequest` is
created, to be subsituted later by a real cache implementation. At the moment
the function `ScriptLoadRequest::NoCacheEntryFound` is used as a placeholder to
change the state of the `ScriptLoadRequest` from `CheckingCache` to `Fetching`.
Existing initializations are replaced by assertions to fail in debug build if
the current patch does not reproduce the expected state properly.

The `LoadedScript` get fields such as the source text, the text length, the
bytecode buffer (which also contains SRI), and the offset at which the bytecode
starts within the bytecode buffer. As these fields are no longer reachable by
name, multiple accessors are added to work-around the issue. Using this as an
opportunity to add extra assertions as part of these accessors.

A new class named `LoadedScriptDelegate` is added to re-add, by inheritance, all
the accessors which used to be part of `ScriptLoadRequest` as methods which are
delegating to the field which is holding the `LoadedScript`. This class is using
templates to avoid virtual inheritance which might hinder inlining, especially
since `ScriptLoadRequest` cannot be made final, as `ModuleLoadRequest` extends
it.

The `ScriptFetchOptions` structure is moved to its own file to solve C++ include
issues.

Differential Revision: https://phabricator.services.mozilla.com/D197921
2024-01-08 14:57:40 +00:00
Tooru Fujisawa 60ae165b14 Bug 1800641 - Part 11: Allocate script in ScriptLoadRequest::NoCacheEntryFound. r=nbp
Depends on D197848

Differential Revision: https://phabricator.services.mozilla.com/D197849
2024-01-08 14:57:40 +00:00
Tooru Fujisawa ed418d41dd Bug 1800641 - Part 10: Add ScriptLoadRequest::mLoadedScript. r=nbp
Depends on D197847

Differential Revision: https://phabricator.services.mozilla.com/D197848
2024-01-08 14:57:39 +00:00
Tooru Fujisawa ad3f8f8a06 Bug 1800641 - Part 8: Add LoadContextBase* parameter to ScriptLoadRequest methods which is going to be moved to LoadedScriptDelegate. r=nbp
Depends on D197845

Differential Revision: https://phabricator.services.mozilla.com/D197846
2024-01-08 14:57:38 +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
Tooru Fujisawa e45786c019 Bug 1800641 - Part 6: Add ScriptLoadRequest::{,Set}ReceivedScriptTextLength. r=nbp
Depends on D197843

Differential Revision: https://phabricator.services.mozilla.com/D197844
2024-01-08 14:57:38 +00:00
Noemi Erli 46e817bca8 Backed out changeset 4d6294424819 (bug 1800641) for causing Bug 1872347 2023-12-29 16:23:18 +02:00
Nicolas B. Pierron 7ad7f045d4 Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia
We are looking into caching loaded script in memory. To do so we need something
to cache.

At the moment, the `ScriptLoadRequest` structure hold all the fields which are
loaded, and used before executing JavaScript code. Then, the `ScriptLoadRequest`
is not guaranteed to out-live the first execution.

Therefore, we have to move fields out of the `ScriptLoadRequest` such that they
can later be used by any caching mechanism. The `LoadedScript` is the closest
existing structure which exists which fit the description.

This patch moves fields out of the ScriptLoadRequest into the `LoadedScript`,
which already has a `LoadedScript` field.

The `LoadedScript` field is initialized sooner, when the `ScriptLoadRequest` is
created, to be subsituted later by a real cache implementation. At the moment
the function `ScriptLoadRequest::NoCacheEntryFound` is used as a placeholder to
change the state of the `ScriptLoadRequest` from `CheckingCache` to `Fetching`.
Existing initializations are replaced by assertions to fail in debug build if
the current patch does not reproduce the expected state properly.

The `LoadedScript` get fields such as the source text, the text length, the
bytecode buffer (which also contains SRI), and the offset at which the bytecode
starts within the bytecode buffer. As these fields are no longer reachable by
name, multiple accessors are added to work-around the issue. Using this as an
opportunity to add extra assertions as part of these accessors.

A new class named `LoadedScriptDelegate` is added to re-add, by inheritance, all
the accessors which used to be part of `ScriptLoadRequest` as methods which are
delegating to the field which is holding the `LoadedScript`. This class is using
templates to avoid virtual inheritance which might hinder inlining, especially
since `ScriptLoadRequest` cannot be made final, as `ModuleLoadRequest` extends
it.

The `ScriptFetchOptions` structure is moved to its own file to solve C++ include
issues.

Differential Revision: https://phabricator.services.mozilla.com/D163615
2023-12-25 09:46:54 +00:00
Cosmin Sabou 78d82c8098 Backed out changeset f69f493b2f3c (bug 1800641) for causing non-unified build bustages on LoadedScript.cpp. CLOSED TREE 2023-12-25 08:38:51 +02:00
Nicolas B. Pierron d60b4bd3b1 Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia
We are looking into caching loaded script in memory. To do so we need something
to cache.

At the moment, the `ScriptLoadRequest` structure hold all the fields which are
loaded, and used before executing JavaScript code. Then, the `ScriptLoadRequest`
is not guaranteed to out-live the first execution.

Therefore, we have to move fields out of the `ScriptLoadRequest` such that they
can later be used by any caching mechanism. The `LoadedScript` is the closest
existing structure which exists which fit the description.

This patch moves fields out of the ScriptLoadRequest into the `LoadedScript`,
which already has a `LoadedScript` field.

The `LoadedScript` field is initialized sooner, when the `ScriptLoadRequest` is
created, to be subsituted later by a real cache implementation. At the moment
the function `ScriptLoadRequest::NoCacheEntryFound` is used as a placeholder to
change the state of the `ScriptLoadRequest` from `CheckingCache` to `Fetching`.
Existing initializations are replaced by assertions to fail in debug build if
the current patch does not reproduce the expected state properly.

The `LoadedScript` get fields such as the source text, the text length, the
bytecode buffer (which also contains SRI), and the offset at which the bytecode
starts within the bytecode buffer. As these fields are no longer reachable by
name, multiple accessors are added to work-around the issue. Using this as an
opportunity to add extra assertions as part of these accessors.

A new class named `LoadedScriptDelegate` is added to re-add, by inheritance, all
the accessors which used to be part of `ScriptLoadRequest` as methods which are
delegating to the field which is holding the `LoadedScript`. This class is using
templates to avoid virtual inheritance which might hinder inlining, especially
since `ScriptLoadRequest` cannot be made final, as `ModuleLoadRequest` extends
it.

The `ScriptFetchOptions` structure is moved to its own file to solve C++ include
issues.

Differential Revision: https://phabricator.services.mozilla.com/D163615
2023-12-25 05:50:53 +00:00
Sylvestre Ledru b0fe72dee5 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan 7388749830 Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru 4a97019e39 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +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