Now the effect of JS::FinishCollectingDelazifications is only to
stop collecting delazifications, which is not necessary for the consumer's side.
The cost of collecting delazification is also negligible with the
InitialStencilAndDelazifications structure, and also keeping the stencil
reference won't result in too much trouble.
Differential Revision: https://phabricator.services.mozilla.com/D266618
scriptloader_bytecode_saved and scriptloader_bytecode_failed are
testing-only events. The tests use them are disabled right now,
and they should be rewritten with the updated cache mechanism.
Differential Revision: https://phabricator.services.mozilla.com/D266616
Non-top-level modules are part of the mCacheableDependencyModules list only when
it passed the condition and until it's queued or dropped.
Thus, being part of the list already meets the requred condition there.
Differential Revision: https://phabricator.services.mozilla.com/D266572
OnFetchComplete will do the error handling and update the state, so we
don't need to call Cancel nor LoadFailed.
Also, ModuleErrored() will call ModuleLoader::OnModuleLoadComplete,
which will move the request to Loaded requests, so we also need to
update HandLoadError as well.
Differential Revision: https://phabricator.services.mozilla.com/D264808
According to the spec, requests created in HostLoadImportedModule have
the isTopLevel flag set to false. This means both static and dynamic
import requests should also have this flag set to false.
[HostLoadImportedModule](https://html.spec.whatwg.org/#hostloadimportedmodule)
Step 14. Fetch a single imported module script ...
[Fetch a single imported module script](https://html.spec.whatwg.org/#fetch-a-single-imported-module-script)
Step 4. Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, moduleRequest, false, and onComplete.
The false argument in the second-to-last parameter of 'Fetch a single
module script' corresponds to the top-levl flag.
[Fetch a single module script](https://html.spec.whatwg.org/#fetch-a-single-module-script)
given a URL url, an environment settings object fetchClient, a
destination destination, a script fetch options options, an environment
settings object settingsObject, a referrer referrer, an optional
ModuleRequest Record moduleRequest, a boolean isTopLevel, an algorithm
onComplete,
The spec was updated in https://github.com/whatwg/html/issues/7996. We’re
updating the implementation to reflect this change.
Differential Revision: https://phabricator.services.mozilla.com/D265593
OnFetchComplete will do the error handling and update the state, so we
don't need to call Cancel nor LoadFailed.
Also, ModuleErrored() will call ModuleLoader::OnModuleLoadComplete,
which will move the request to Loaded requests, so we also need to
update HandLoadError as well.
Differential Revision: https://phabricator.services.mozilla.com/D264808
According to the spec, requests created in HostLoadImportedModule have
the isTopLevel flag set to false. This means both static and dynamic
import requests should also have this flag set to false.
[HostLoadImportedModule](https://html.spec.whatwg.org/#hostloadimportedmodule)
Step 14. Fetch a single imported module script ...
[Fetch a single imported module script](https://html.spec.whatwg.org/#fetch-a-single-imported-module-script)
Step 4. Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, moduleRequest, false, and onComplete.
The false argument in the second-to-last parameter of 'Fetch a single
module script' corresponds to the top-levl flag.
[Fetch a single module script](https://html.spec.whatwg.org/#fetch-a-single-module-script)
given a URL url, an environment settings object fetchClient, a
destination destination, a script fetch options options, an environment
settings object settingsObject, a referrer referrer, an optional
ModuleRequest Record moduleRequest, a boolean isTopLevel, an algorithm
onComplete,
The spec was updated in https://github.com/whatwg/html/issues/7996. We’re
updating the implementation to reflect this change.
Differential Revision: https://phabricator.services.mozilla.com/D265593
This patch will look for functions during instantiation that have bytecode and jit hints and will eagerly dispatch baseline compilations off the main thread when present.
Differential Revision: https://phabricator.services.mozilla.com/D261939
This avoids the small overhead and potential for bugs from the previous
approach of assuming all `const char*` arguments passed to `nsITimer`
initializers are string literals, by instead requiring the argument to be a
`const nsACString&`. This involves changing all callsites to pass a `""_ns`
string literal down instead of a bare string literal.
It appears that while there were currently no buggy callers which
would've provided a dynamic string, there was at least one piece of code
(nsRepeatService::Start) which did pass down a raw char* which may be
dynamically allocated (all callers pass down `nsLiteralCString` so we're
actually OK here right now, but this was a footgun).
Differential Revision: https://phabricator.services.mozilla.com/D261032
This reverts commit 8c929cc018.
Revert "Bug 1979013 - Part 2: Require nsITimer API callers to provide a nsACString, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,profiler-reviewers,dom-storage-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,mstange,emz,bwc,janv,emilio,padenot"
This reverts commit e01c0a6a32.
Revert "Bug 1979013 - Part 1: Eagerly fetch name for timer callbacks, r=xpcom-reviewers,mccr8"
This reverts commit 9f8e73c163.
This avoids the small overhead and potential for bugs from the previous
approach of assuming all `const char*` arguments passed to `nsITimer`
initializers are string literals, by instead requiring the argument to be a
`const nsACString&`. This involves changing all callsites to pass a `""_ns`
string literal down instead of a bare string literal.
It appears that while there were currently no buggy callers which
would've provided a dynamic string, there was at least one piece of code
(nsRepeatService::Start) which did pass down a raw char* which may be
dynamically allocated (all callers pass down `nsLiteralCString` so we're
actually OK here right now, but this was a footgun).
Differential Revision: https://phabricator.services.mozilla.com/D261032
JS::FinishCollectingDelazifications with TranscodeBuffer is the equivalent of
JS::FinishCollectingDelazifications with stencil and JS::EncodeStencil, and
nothing is optimized (e.g. skip some allocation etc).
Differential Revision: https://phabricator.services.mozilla.com/D260912
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