Remove CompilerEnvironment from ModuleEnvironment
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: rhunt, Assigned: rhunt)
Details
Attachments
(2 files)
This is purely a code cleanup task.
ModuleEnvironment contains a CompilerEnvironment pointer, which describes the compiler selection, tiering, and whether debugging is enabled. None of this information is needed for validation, so wasm::Validate() has to create a synthetic CompilerEnvironment which is never read. This isn't a large issue, but indicates ModuleEnvironment is doing too many things.
I think it would be cleaner if we passed the CompilerEnvironment along with the ModuleEnvironment through the compiler pipeline, and removed this responsibility from ModuleEnvironment.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
The next commit will move CompilerEnvironment out of ModuleEnvironment and pass it
through the compiler pipeline. The compiler pipeline typically uses 'env_' to refer
to the module environment, with a 'compilerEnv_' being used as well I think we should
rename 'env_' to 'moduleEnv_'.
The one exception is within validation/decoding where I think using just 'env_' to
refer to the module environment is fine.
Assignee | ||
Comment 3•5 years ago
|
||
ModuleEnvironment contains a CompilerEnvironment pointer, which describes the compiler selection,
tiering, and whether debugging is enabled. None of this information is needed for validation,
so wasm::Validate() has to create a synthetic CompilerEnvironment which is never read. This
isn't a large issue, but indicates ModuleEnvironment is doing too many things.
This commit removes CompilerEnvironment from ModuleEnvironment and pipes it
through the compiler pipeline. This is fairly straightforward except for:
- wasm::Validate() no longer needs to create a synthetic compiler env
- DecodeModuleEnvironment() used to invoke moduleEnv.compilerEnv.computeParameters(d)
after the preamble was decoded. I believe this was needed for handling the GC opt-in
section, which is no longer used. I moved this call to computeParameters() to after
all callers of DecodeModuleEnvironment(). - I added an assertion in IonCompileFunctions/CraneliftCompileFunctions that they are
not being invoked for debugged modules.
Depends on D91994
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9652ae0962ac
https://hg.mozilla.org/mozilla-central/rev/cd62c4bc2412
Description
•