Cache module scripts in the bytecode cache
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox100 | --- | fixed |
People
(Reporter: jonco, Assigned: arai)
References
Details
Attachments
(14 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 2•3 years ago
|
||
| Assignee | ||
Comment 3•3 years ago
|
||
Depends on D140288
| Assignee | ||
Comment 4•3 years ago
|
||
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.
Depends on D140289
| Assignee | ||
Comment 5•3 years ago
|
||
To add conditional JS::StartIncrementalEncoding, and also to add a bytecode
decoding branch, replace nsJSUtils::CompileModule with raw JSAPI calls with
Stencil.
Depends on D140290
| Assignee | ||
Comment 6•3 years ago
|
||
Module bytecode should use different MIME type, to avoid mixing up script/module
bytecodes for single JS file.
This patch adds a static method that simply returns the current bytecode MIME
type.
The later patch adds a new MIME type for module bytecode and modify the
ScriptLoader::BytecodeMimeTypeFor method to return corresponding MIME type.
Depends on D140291
| Assignee | ||
Comment 7•3 years ago
|
||
Depends on D140292
| Assignee | ||
Comment 8•3 years ago
|
||
Module's ScriptSlot is cleared after executing the top-level script.
In order to skip modules imported multiple times when encoding, added
JS::IsExecutedModule.
Depends on D140293
| Assignee | ||
Comment 9•3 years ago
|
||
As a preparation to use the bytecode encoding in the module evaluation code,
ScriptLoader::MaybePrepareForBytecodeEncoding is split into 2 parts:
- one for performing preparation before executing script
- one for queuing the request for bytecode encoding after executing script
In module's case, the bytecode encoding handling must be done on the entire
import tree, and also the module object's ScriptSlot is cleared on execution.
So, the script reference must be copied to the corresponding script load request
field before execution, and the script source must be queued for bytecode
encoding after executing the top-level script, so that incremental encoding
reflects functions called there.
Depends on D140294
| Assignee | ||
Comment 10•3 years ago
|
||
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.
Depends on D140295
| Assignee | ||
Comment 11•3 years ago
|
||
Depends on D140296
Updated•3 years ago
|
| Assignee | ||
Comment 12•3 years ago
|
||
After enabling bytecode cache for module script, we need to handle
the SRI mismatch on bytecode cache, that requires reloading the script source
again.
Depends on D140296
Updated•3 years ago
|
| Assignee | ||
Comment 13•3 years ago
|
||
Depends on D140297
| Assignee | ||
Comment 14•3 years ago
|
||
Depends on D140552
| Assignee | ||
Comment 15•3 years ago
|
||
Depends on D140553
| Assignee | ||
Comment 16•3 years ago
|
||
TODO: add testcase with <link rel="preload">
| Assignee | ||
Comment 17•3 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #16)
TODO: add testcase with
<link rel="preload">
This was unrelated here.
will post test with iframes.
| Assignee | ||
Comment 18•3 years ago
|
||
Depends on D140554
Comment 19•3 years ago
|
||
Comment 20•3 years ago
|
||
Backed out along with Bug 1757597 for causing mochitest failures on test_bug1656248.html
Comment 21•3 years ago
•
|
||
New failure log , involving the above backout :
https://treeherder.mozilla.org/logviewer?job_id=371065622&repo=autoland&lineNumber=2707
Comment 22•3 years ago
|
||
Comment 23•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ee0194a35613
https://hg.mozilla.org/mozilla-central/rev/a4c1a6688a8c
https://hg.mozilla.org/mozilla-central/rev/3a587ff43de9
https://hg.mozilla.org/mozilla-central/rev/dc2dc93cafaf
https://hg.mozilla.org/mozilla-central/rev/d8dbb7131db9
https://hg.mozilla.org/mozilla-central/rev/b5378c419f06
https://hg.mozilla.org/mozilla-central/rev/d4847bfb8b12
https://hg.mozilla.org/mozilla-central/rev/f43d53e2b41e
https://hg.mozilla.org/mozilla-central/rev/53bd843e4e47
https://hg.mozilla.org/mozilla-central/rev/03c914329e22
https://hg.mozilla.org/mozilla-central/rev/f2ff76a6acf5
https://hg.mozilla.org/mozilla-central/rev/2408f4c4260a
https://hg.mozilla.org/mozilla-central/rev/38be4c94b912
https://hg.mozilla.org/mozilla-central/rev/123ba639073b
| Assignee | ||
Updated•3 years ago
|
Description
•