Clone ExtensibleCompilationStencil
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
References
Details
Attachments
(3 files)
After parsing off-thread, we want to delazify off-thread. To do so we have to duplicate the ExtensibleCompilationStencil, such that the main-thread can use a pristine stencil for instantiation and encoding of used stencils, while the helper thread can mutate its own extensible stencil with eagerly delazified functions.
Without a cloned stencil, we risk:
- Adding unused functions to the bytecode cache, increasing disk space.
- Only delazify before the execution, thus no opportunity to delazify the functions of the last script ahead of its execution.
Assignee | ||
Comment 1•2 years ago
|
||
As of today, converting a CompilationStencil to an ExtensibleCompilationStencil
is only done with UniquePtr<..>, which is fine. However, as we are attempting to
cache RefPtr<CompilationStencil>, we should be careful when cloning that we are
not stealing data which might still be referenced from else-where.
This patch add the CompilationStencil::isShared function which checks whether
the data referenced is borrowed, or if it is referenced multiple times. If so,
we default to cloning the CompilationStencil instead of stealing its' LifoAlloc.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
As we want to delazify functions, in addition of being able to instantiate the
top-level parsed content. We need an ExtensibleCompilationStencil for the
CompilationStencilMerger.
This patch adds clone functions to ExtensibleCompilationStencil, to clone from
either a CompilationStencil or from an ExtensibleCompilationStencil.
Assignee | ||
Comment 3•2 years ago
|
||
With off-thread delazification, the parser created and destroyed its
CompilationInput. Thus we have to carry the compilation information to the
cloned ExtensibleCompilationStencil.
This patch adds a new constructor to ExtensibleCompilationStencil which can be
constructed with CompileOptions and a ScriptSource pointer.
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5d2c54085c67 Clone SharedDataContainer when needed. r=arai https://hg.mozilla.org/integration/autoland/rev/be5163574112 Add ExtensibleCompilationStencil::cloneFrom functions. r=arai https://hg.mozilla.org/integration/autoland/rev/9e69cc757fc4 Make ExtensibleCompilationStencil constructible without CompilationInput. r=arai
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5d2c54085c67
https://hg.mozilla.org/mozilla-central/rev/be5163574112
https://hg.mozilla.org/mozilla-central/rev/9e69cc757fc4
Description
•