Marian-Vasile Laza
a3aadc47df
Backed out 3 changesets (bug 1763586) foar causing sm bustages. CLOSED TREE
...
Backed out changeset 02a961432a49 (bug 1763586)
Backed out changeset 3fc84237decb (bug 1763586)
Backed out changeset 365eff56ce0f (bug 1763586)
2022-04-12 09:49:21 -07:00
Yulia Startsev
5dd282eb7d
Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-12 16:16:31 +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
95257109ee
Bug 1761938 - Part 4: Give module loaders a global object field r=smaug,yulia
...
This gives the module loader a field for the current global, since a module map
is only associated with a single global.
This adds a method to Document to tell the script loader when its global
changes. I'm not sure of when we do this exactly.
Differential Revision: https://phabricator.services.mozilla.com/D142831
2022-04-11 15:35:29 +00:00
Jon Coppeard
e78bb3903c
Bug 1761938 - Part 2: Give each web extension content script global its own module loader r=smaug,yulia
...
This gives the DOM module loader a kind and records content script module
loaders in an array on the script loader.
Differential Revision: https://phabricator.services.mozilla.com/D142829
2022-04-11 15:35:28 +00:00
Butkovits Atila
39b9b1aad9
Merge mozilla-central to autoland. CLOSED TREE
2022-03-29 00:52:16 +03:00
Butkovits Atila
f59884010a
Merge autoland to mozilla-central. a=merge
2022-03-29 00:33:50 +03:00
Jon Coppeard
ed61ae9b57
Bug 1759881 - Part 10: Move the generic parts of the StartLoad method to the module loader base r=yulia
...
StartModuleLoadImpl moves to the base class and uses to new virtual methods
CanStartLoad and StartFetch which are implemented by the derived class.
Differential Revision: https://phabricator.services.mozilla.com/D141736
2022-03-28 15:56:10 +00:00
Jon Coppeard
8d15122f96
Bug 1759881 - Part 9: Move module loading hooks into the generic module loader r=yulia
...
Now we can move the JS engine integration hooks into the generic module loader.
There is still some code there to deal with web extension globals. This will be
removed in a later patch.
Differential Revision: https://phabricator.services.mozilla.com/D141735
2022-03-28 12:38:28 +00:00
Jon Coppeard
bea8156b2f
Bug 1759881 - Part 8: Add a virtual method to create a module load request for a dynamic import r=yulia
...
This adds a new virtual to the module loader base, along the same lines as the
one to create a load request for a static import. This makes the
HostImportModuleDynamically hook generic.
Differential Revision: https://phabricator.services.mozilla.com/D141734
2022-03-28 12:38:28 +00:00
Jon Coppeard
293d8c4086
Bug 1759881 - Part 7: Add a virtual method to get the module loader to use for the current global r=yulia,smaug
...
This adds a virtual method to nsIGlobalObject and implements it for
nsGlobalWindowInner and SandboxPrivate. This means we don't have to put the
logic for dealing with all the different kinds of globals in once place.
Differential Revision: https://phabricator.services.mozilla.com/D141733
2022-03-28 12:38:27 +00:00
Jon Coppeard
1bb3a3fa3a
Bug 1761432 - Part 4: Rename state accessor methods after the enum values r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142044
2022-03-25 10:54:17 +00:00
Jon Coppeard
4baf2c7e5a
Bug 1759881 - Part 1: Make list of dynamic import requests private r=yulia
...
This restricts access to mDynamicImportRequests and adds the appropriate accessors.
Differential Revision: https://phabricator.services.mozilla.com/D141248
2022-03-17 15:22:16 +00:00
Tooru Fujisawa
1d53179c23
Bug 1436400 - Part 10: Support bytecode cache for module script. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D140297
2022-03-15 19:05:57 +00:00
Tooru Fujisawa
269bab5cb4
Bug 1436400 - Part 9: Support restarting module load request. r=jonco
...
After enabling bytecode cache for module script, we need to handle
the SRI mismatch on bytecode cache, that requires reloading the script source
again.
Differential Revision: https://phabricator.services.mozilla.com/D140551
2022-03-15 19:05:57 +00:00
Tooru Fujisawa
8a92b769e9
Bug 1436400 - Part 8: Add code path for bytecode encoding module scripts. r=nbp
...
The module scripts are scanned immediately before executing, and if the
module script is not yet executed, and it matches the requirement for encoding
(size, fetch count, etc), it's marked as encode,
and they're scanned again immediately after executing, and marked scripts are
queued for bytecode encoding.
This patch doesn't actually enable the encoding, given ShouldCacheBytecode
returns false because the caching is not enabled for the channel and
GetCacheTokenFetchCount fails.
Differential Revision: https://phabricator.services.mozilla.com/D140296
2022-03-15 19:05:56 +00:00
Tooru Fujisawa
4750290405
Bug 1436400 - Part 3: Remove nsJSUtils::CompileModule and directly use JSAPI with stencil. r=nbp
...
To add conditional JS::StartIncrementalEncoding, and also to add a bytecode
decoding branch, replace nsJSUtils::CompileModule with raw JSAPI calls with
Stencil.
Differential Revision: https://phabricator.services.mozilla.com/D140291
2022-03-15 19:05:54 +00:00
Tooru Fujisawa
4a512c6faf
Bug 1436400 - Part 2: Simplify ModuleLoader::CompileOrFinishModuleScript code flow. r=jonco
...
As a preparation to add bytecode case to CompileOrFinishModuleScript, removed
the shared nsresult variable and make each branch directly return, and also
do early return for error case.
Differential Revision: https://phabricator.services.mozilla.com/D140290
2022-03-15 19:05:54 +00:00
Csoregi Natalia
cae02f7373
Backed out 15 changesets (bug 1757597, bug 1436400) for causing mochitest failures on test_bug1656248.html. CLOSED TREE
...
Backed out changeset 4be29c1eb5bc (bug 1436400)
Backed out changeset ffd9ddcef6b0 (bug 1436400)
Backed out changeset 5ac844508d8b (bug 1436400)
Backed out changeset 561aeb550892 (bug 1436400)
Backed out changeset 6f473bcf809a (bug 1436400)
Backed out changeset c33620854115 (bug 1436400)
Backed out changeset 8f894ea40eb2 (bug 1436400)
Backed out changeset cce080064d82 (bug 1436400)
Backed out changeset 001d8528ff96 (bug 1436400)
Backed out changeset dd2bb1b46f75 (bug 1436400)
Backed out changeset b1c2084042fa (bug 1436400)
Backed out changeset dd0fea93bcd7 (bug 1436400)
Backed out changeset e38a959648e1 (bug 1436400)
Backed out changeset 40b474d430e9 (bug 1436400)
Backed out changeset 5bef21ef1ba2 (bug 1757597)
2022-03-15 07:23:29 +02:00
Tooru Fujisawa
01e163cded
Bug 1436400 - Part 10: Support bytecode cache for module script. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D140297
2022-03-15 04:24:52 +00:00
Tooru Fujisawa
f7cf7c27a9
Bug 1436400 - Part 9: Support restarting module load request. r=jonco
...
After enabling bytecode cache for module script, we need to handle
the SRI mismatch on bytecode cache, that requires reloading the script source
again.
Differential Revision: https://phabricator.services.mozilla.com/D140551
2022-03-15 04:24:52 +00:00
Tooru Fujisawa
19684deae9
Bug 1436400 - Part 8: Add code path for bytecode encoding module scripts. r=nbp
...
The module scripts are scanned immediately before executing, and if the
module script is not yet executed, and it matches the requirement for encoding
(size, fetch count, etc), it's marked as encode,
and they're scanned again immediately after executing, and marked scripts are
queued for bytecode encoding.
This patch doesn't actually enable the encoding, given ShouldCacheBytecode
returns false because the caching is not enabled for the channel and
GetCacheTokenFetchCount fails.
Differential Revision: https://phabricator.services.mozilla.com/D140296
2022-03-15 04:24:51 +00:00
Tooru Fujisawa
02ac05b229
Bug 1436400 - Part 3: Remove nsJSUtils::CompileModule and directly use JSAPI with stencil. r=nbp
...
To add conditional JS::StartIncrementalEncoding, and also to add a bytecode
decoding branch, replace nsJSUtils::CompileModule with raw JSAPI calls with
Stencil.
Differential Revision: https://phabricator.services.mozilla.com/D140291
2022-03-15 04:24:49 +00:00
Tooru Fujisawa
aae1b65b7c
Bug 1436400 - Part 2: Simplify ModuleLoader::CompileOrFinishModuleScript code flow. r=jonco
...
As a preparation to add bytecode case to CompileOrFinishModuleScript, removed
the shared nsresult variable and make each branch directly return, and also
do early return for error case.
Differential Revision: https://phabricator.services.mozilla.com/D140290
2022-03-15 04:24:49 +00:00
Yulia Startsev
fedbc58156
Bug 1756550 - propagate webext global to all dynamically imported modules; r=jonco
...
The crashes were occurring due to the missing webext global on dynamically imported modules from a referencing script. There is likely a more elegant way to reintroduce this, but for now this is a quick fix.
Differential Revision: https://phabricator.services.mozilla.com/D139511
2022-02-24 12:25:25 +00:00
Yulia Startsev
d54aad3909
Bug 1742437 - re-scope all generic module/script loader files under js/loader; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D138133
2022-02-21 15:39:09 +00:00
Yulia Startsev
90aecf0d25
Bug 1742437 - move DOM script context into own file and rename it; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D138132
2022-02-21 15:39:08 +00:00
Yulia Startsev
75874e0bcd
Bug 1742437 - move DOM module loader into own file; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D137531
2022-02-21 15:39:08 +00:00
Yulia Startsev
dccad45b5d
Bug 1742437 - Create DOM specific Module Loader; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D137298
2022-02-21 15:39:07 +00:00
Yulia Startsev
b58fcd4a44
Bug 1742437 - move mWebExtGlobal from ScriptLoadRequest to DOMScriptLoadContext; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D136744
2022-02-21 15:39:06 +00:00
Yulia Startsev
0ed52f4823
Bug 1742437 - move mElement from ScriptFetchOptions to DOMScriptLoadContext; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D136742
2022-02-21 15:39:05 +00:00
Yulia Startsev
55cd96e998
Bug 1742437 - Split ScriptLoadRequest into ScriptLoadRequest and DOMScriptLoadContext; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D134041
2022-02-21 15:39:04 +00:00
Norisz Fay
87b7611370
Backed out 12 changesets (bug 1742437) for causing Bp-hybrid bustages on ModuleLoader.obj
...
Backed out changeset 7d5683180ac3 (bug 1742437)
Backed out changeset a48aff5f2555 (bug 1742437)
Backed out changeset 7e54a223001d (bug 1742437)
Backed out changeset 3a34d557d474 (bug 1742437)
Backed out changeset f29451ea18dc (bug 1742437)
Backed out changeset c0bd1d29be62 (bug 1742437)
Backed out changeset 8b970fb6e4e6 (bug 1742437)
Backed out changeset 729c48e34d6b (bug 1742437)
Backed out changeset 9355004c7f6a (bug 1742437)
Backed out changeset 0a5f61274aed (bug 1742437)
Backed out changeset a50f60a612d3 (bug 1742437)
Backed out changeset 0ac6d9d26e2b (bug 1742437)
2022-02-18 00:00:41 +02:00
Yulia Startsev
5b984dcbfb
Bug 1742437 - re-scope all generic module/script loader files under js/loader; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D138133
2022-02-17 15:57:52 +00:00
Yulia Startsev
e92cc07dad
Bug 1742437 - move DOM script context into own file and rename it; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D138132
2022-02-17 15:57:51 +00:00
Yulia Startsev
fce4457549
Bug 1742437 - move DOM module loader into own file; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D137531
2022-02-17 15:57:51 +00:00
Yulia Startsev
f532c642d3
Bug 1742437 - Create DOM specific Module Loader; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D137298
2022-02-17 15:57:50 +00:00
Yulia Startsev
c72a87da4b
Bug 1742437 - move mWebExtGlobal from ScriptLoadRequest to DOMScriptLoadContext; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D136744
2022-02-17 15:57:49 +00:00
Yulia Startsev
21c237b046
Bug 1742437 - move mElement from ScriptFetchOptions to DOMScriptLoadContext; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D136742
2022-02-17 15:57:48 +00:00
Yulia Startsev
70ff292d33
Bug 1742437 - Split ScriptLoadRequest into ScriptLoadRequest and DOMScriptLoadContext; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D134041
2022-02-17 15:57:48 +00:00
Philip Chimento
966774d169
Bug 1735200 - Add cause argument to JS::CreateError(). r=jandem
...
Add a cause argument to JS::CreateError(), in order to be able to create
errors with cause through the public API.
Differential Revision: https://phabricator.services.mozilla.com/D135931
2022-01-17 15:23:40 +00:00
Jonatan Klemets
456d24426d
Bug 1735695 - Remove OOM error in FinishDynamicImport when CreateModuleRequest fails. r=arai
...
As stated in the bug we do not need to report OOM on error since this is handled
by CreateModuleRequest.
Differential Revision: https://phabricator.services.mozilla.com/D134707
2021-12-27 17:48:46 +00:00
Yulia Startsev
220e8ff395
Bug 1745626 - Dynamic import should always try to unblock onload event in DOM context; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D133629
2021-12-14 10:53:58 +00:00
Tooru Fujisawa
a95f884d9f
Bug 1734098 - Part 7: Add JS::CompileModuleToStencilOffThread. r=tcampbell
...
Differential Revision: https://phabricator.services.mozilla.com/D133048
2021-12-10 04:28:28 +00:00
Iulian Moraru
e83fdb85a5
Backed out 17 changesets (bug 1744178, bug 1734098) for causing leaks. CLOSED TREE
...
Backed out changeset 08070838c7d2 (bug 1734098)
Backed out changeset cfdf7ed9a5a2 (bug 1734098)
Backed out changeset 02d7ca7fc45c (bug 1734098)
Backed out changeset 7b7c59fc644b (bug 1734098)
Backed out changeset 630055366dac (bug 1734098)
Backed out changeset da83b4571cf2 (bug 1734098)
Backed out changeset 323af9d3e0e1 (bug 1734098)
Backed out changeset cf458ad5345a (bug 1734098)
Backed out changeset a85846f79eb5 (bug 1734098)
Backed out changeset 0d07931e6bc8 (bug 1734098)
Backed out changeset ffd72fa3fc59 (bug 1734098)
Backed out changeset 3174f1ecfd03 (bug 1734098)
Backed out changeset cfb19671fd4e (bug 1734098)
Backed out changeset c3b9c8221059 (bug 1734098)
Backed out changeset 532328aedaaa (bug 1734098)
Backed out changeset 48aa5ca15135 (bug 1734098)
Backed out changeset 6ca5bceb693c (bug 1744178)
2021-12-09 23:36:34 +02:00
Tooru Fujisawa
05f5605a4e
Bug 1734098 - Part 7: Add JS::CompileModuleToStencilOffThread. r=tcampbell
...
Differential Revision: https://phabricator.services.mozilla.com/D133048
2021-12-09 18:21:12 +00:00
Yulia Startsev
d159b2e9fd
Bug 1311726 - Split ScriptLoader into ScriptLoader and ModuleLoader; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D132683
2021-12-09 13:26:21 +00:00
Butkovits Atila
9982657a6a
Backed out 18 changesets (bug 1311726) for causing Hazard failures at ScriptLoader.cpp:. CLOSED TREE
...
Backed out changeset 0e1179305bc2 (bug 1311726)
Backed out changeset fd3a9e4f5e5e (bug 1311726)
Backed out changeset d6f6a7d13dc2 (bug 1311726)
Backed out changeset 7b266f1fbbff (bug 1311726)
Backed out changeset 9ecb9ac4f2f7 (bug 1311726)
Backed out changeset 2deb35690efb (bug 1311726)
Backed out changeset a151ddb7068d (bug 1311726)
Backed out changeset 79aac20615b8 (bug 1311726)
Backed out changeset 258188246118 (bug 1311726)
Backed out changeset 0ef6c06dac5b (bug 1311726)
Backed out changeset 340bd3d73849 (bug 1311726)
Backed out changeset d130a9772d31 (bug 1311726)
Backed out changeset 15df1b7e0208 (bug 1311726)
Backed out changeset ebc87f932050 (bug 1311726)
Backed out changeset 68ab853d072d (bug 1311726)
Backed out changeset eac12c9d76b7 (bug 1311726)
Backed out changeset beb9e9b17522 (bug 1311726)
Backed out changeset bfea110e6afe (bug 1311726)
2021-12-09 02:23:18 +02:00
Yulia Startsev
8e5d0bf0c6
Bug 1311726 - Split ScriptLoader into ScriptLoader and ModuleLoader; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D132683
2021-12-08 16:57:23 +00:00
Narcis Beleuzu
dc53a1d420
Backed out 18 changesets (bug 1311726) for failures on test_script_loader_js_cache.html . CLOSED TREE
...
Backed out changeset 1f9c13be6642 (bug 1311726)
Backed out changeset 2f4e89d930b0 (bug 1311726)
Backed out changeset 03f767c08221 (bug 1311726)
Backed out changeset b21e580a778f (bug 1311726)
Backed out changeset 4597b327e9be (bug 1311726)
Backed out changeset 558fec312301 (bug 1311726)
Backed out changeset b758abeed4cc (bug 1311726)
Backed out changeset a909be9fa973 (bug 1311726)
Backed out changeset 8db98e65b147 (bug 1311726)
Backed out changeset ee2e01e59950 (bug 1311726)
Backed out changeset 40c635fb36eb (bug 1311726)
Backed out changeset 6ba119a4e33e (bug 1311726)
Backed out changeset 1ad7d1308b5f (bug 1311726)
Backed out changeset dd2dbe11315d (bug 1311726)
Backed out changeset a8279e757309 (bug 1311726)
Backed out changeset 1de8b528723e (bug 1311726)
Backed out changeset f1e4c9199289 (bug 1311726)
Backed out changeset 23ea474c05ec (bug 1311726)
2021-12-08 12:46:07 +02:00