Remove unnecessary includes in js/src/jit
Categories
(Core :: JavaScript Engine: JIT, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(8 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
- Remove unnecessary includes in js/src/jit
- Remove "vm/{JS,Native}Object.h" in MacroAssembler.h
- Remove the transitive include of "MacroAssembler.h" into the vm/ and frontend/
Assignee | ||
Comment 1•3 years ago
|
||
Fix unused functions and "code after return" warnings when building in non-unified
mode.
Assignee | ||
Comment 2•3 years ago
|
||
Bug 1669181 focused on removing unnecessary includes in header files. As a
follow-up, this bug also removes unnecessary includes in non-header files.
The unnecessary includes were determined through IWYU as follows:
- Touch a cpp file.
- Recompile through IWYU. Step 1 ensures only the unnecessary includes for
this cpp file (and its header file) are reported. - Remove the unnecessary includes and recompile normally. Fix up any missing
includes. - Go back to step 1 to modify the next cpp file.
Depends on D122461
Assignee | ||
Comment 3•3 years ago
|
||
The include of "vm/NativeObject.h" is only needed for static assertions. When
we move these assertions into a separate cpp file, we can avoid the #include
.
And then fix up any missing includes after the removal of the "vm/NativeObject.h"
include in "Assembler-shared.h".
Depends on D122462
Assignee | ||
Comment 4•3 years ago
|
||
"MacroAssembler.h" includes "WasmFrame.h", which in turn includes
"WasmValue.h" and "WasmValue.h" includes "NativeObject.h". If we move
wasm::DebugFrame
from "WasmFrame.h" into a separate header file, we can
avoid the transitive include of "NativeObject.h" in "MacroAssembler.h".
Depends on D122463
Assignee | ||
Comment 5•3 years ago
|
||
Move both includes into "MacroAssembler-inl.h" to reduce the number of direct
includes to "vm" headers from "MacroAssembler.h".
Depends on D122464
Assignee | ||
Comment 6•3 years ago
|
||
Move the definition into the cpp-file to match "MacroAssembler-arm.cpp".
Depends on D122465
Assignee | ||
Comment 7•3 years ago
|
||
"wasm/WasmFrameIter.h" includes "wasm/WasmCode.h", which in turn includes "wasm/WasmGC.h" and
"wasm/WasmGC.h" includes "jit/MacroAssembler.h". And because "wasm/WasmFrameIter.h" is included
by "vm/JitActivation.h", which in turn is included by "vm/Activation-inl.h", which in turn is
included by "vm/JSContext-inl.h", "jit/MacroAssembler.h" ends up being included in many cpp files
throughout SpiderMonkey. Thankfully "wasm/WasmFrameIter.h" doesn't actually need some includes,
so we can easily avoid the transitive includes.
Drive-by fix:
- Also remove some unnecessary includes in "wasm/WasmCode.h".
And after removing the unnecessary includes in the header files, fix up any missing includes
which prevents successful recompilation.
Depends on D122466
Assignee | ||
Comment 8•3 years ago
|
||
This way we can avoid including all of "MacroAssembler.h" in "WasmGC.h".
Depends on D122467
Comment 10•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d637593c7871
https://hg.mozilla.org/mozilla-central/rev/5926f8d136f0
https://hg.mozilla.org/mozilla-central/rev/8af00325c0c2
https://hg.mozilla.org/mozilla-central/rev/32005d328e91
https://hg.mozilla.org/mozilla-central/rev/b32b20a1d3c5
https://hg.mozilla.org/mozilla-central/rev/4eba746b6dc5
https://hg.mozilla.org/mozilla-central/rev/a1f612022e4c
https://hg.mozilla.org/mozilla-central/rev/4792c28298b3
Description
•