Followups to bug 1891182 (refactoring of ModuleGenerator and ModuleEnvironment)
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: jseward, Assigned: jseward)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
The following cleanup items resulting from bug 1891182 need to be done:
(2) = higher priority, (3) = lower priority
CM = CodeMetadata, MM = ModuleMetadata
-
move
(3) CM::codeSection to MM
(3) CM::customSectionRanges to MM (maybe complexity with Decoder)
(2) Module::{dataSegments_, elemSegments_, customSections_} to MM -
(2-3) assess the costs of passing around RefPtr<CM/MM> rather than
plain CM*/MM*; fix if needed -
(2)
space accounting:
fix CodeMetadata::sizeOfExcludingThis (if it needs fixing)
fix CodeMetadataForAsmJS::sizeOfExcludingThis (maybe?)
fix Module::initGCMallocBytesExcludingCode
Module::addSizeOfMisc: move imports_/exports_ accounting to MM -
(2) wasm::CompileTier2: why does this create a ModuleMetadata?
(also .. and a CodeMetadata?) Neither is necessary.
-- this is a nasty tangle -
(3) give MM a RefPtr to CM
Assignee | ||
Comment 1•8 months ago
|
||
This patch removes Module::{dataSegments_, elemSegments_, customSections_} and
adds ModuleMetadata::{dataSegments, customSections} instead.
ModuleMetadata::elemSegments already exists but was only used during module
generation.
The new code does the obvious thing -- those fields now live permanently in
ModuleMetadata. This was mostly straightforward, apart from a bit of
hoop-jumping in the deserializer, due to a circular dependency: Code must be
deserialized before ModuleMetadata so as to make types available, but Code
needs to have its codeMeta().nameCustomSectionIndex field set by using info
from ModuleMetadata.
A few comments have been tidied up.
Assignee | ||
Comment 2•8 months ago
|
||
Bug 1891182 majorly mashed around source metadata management for wasm and
asm.js, resulting in breakage to various memory reporter routines. This patch
is a best-effort attempt to fix up sizeOfExcludingThis() for
CodeMetadataForAsmJSImpl, CodeMetadata and ModuleMetadata.
Module::initGCMallocBytesExcludingCode has also been changed.
Comment 4•7 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f6e5093b8775
https://hg.mozilla.org/mozilla-central/rev/2f5cd98ee842
Description
•