Closed Bug 1742142 Opened 3 years ago Closed 3 years ago

Clean-up some includes in js/src/frontend

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(17 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
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Clean-up some includes in "js/src/frontend". For the most part remove unnecessary includes and try to avoid including "js/src/vm" in frontend header files if possible.

Use IWYU to correct all includes and forward declarations for "SharedContext".

Use IWYU to correct all includes and forward declarations for "ModuleSharedContext".

Depends on D131647

Use IWYU to correct all includes and forward declarations for "AbstractScopePtr".

Depends on D131648

"Opcodes.h" includes "vm/WellKnownAtom.h" for five js_x_str definitions. These
are only used by CodeToken in "vm/BytecodeUtil.cpp". If we replace them with
string literals, we can avoid including "vm/WellKnownAtom.h" and all its transitive
includes, which is useful because "Opcodes.h" is included in many files.

Depends on D131649

We have a surprisingly large number of files which are including "Opcodes.h"
for the definition of JSOp, even though JSOp is actually defined in
"BytecodeUtil.h". Let's move the definition of JSOp into "Opcodes.h" to match
where people expect it should be defined.

Depends on D131650

Replace all "BytecodeUtil.h" includes with "Opcodes.h" when only needed for the
definition of JSOp. Also remove all "BytecodeUtil.h" includes which don't use
any definition from "BytecodeUtil.h" or "Opcodes.h".

Depends on D131651

Parts 1-3 performed a thorough clean-up of include statements, where unnecessary
includes were removed and missing includes were added. This patch only removes
unnecessary includes. Additional includes were mostly only added to ensure the
files can stil be built.

Depends on D131652

"frontend/ParserAtom.h" includes "vm/StringType.h" for the definition of
StaticStrings. If we move StaticStrings into a separate file, we can avoid
including "vm/StringType.h" in "frontend/ParserAtom.h", which is useful because
"frontend/ParserAtom.h" is (transitively) included in many files.

Depends on D131653

The previous part moved StaticStrings into a separate file, but didn't update
the includes to use "vm/StaticStrings.h".

Depends on D131655

After parts 8-9, the "vm/StringType.h" include was only needed for
JSString::MAX_LENGTH. If we remove that (unused!) reference, we can remove
the include to "vm/StringType.h". And then fix any missing includes which were
previously only transitively included through "vm/StringType.h".

Depends on D131656

Inlines SetAliasedVarOperation in preparation for the next part. Also removes
unnecessary parameters.

Depends on D131657

Moves MaybeCheckTDZ, so we don't have to include "vm/Stack.h" in
"frontend/TDZCheckCache.h".

Depends on D131658

FireOnNewScripts is unused, when we remove it, we can remove another include
from "frontend/BytecodeCompilation.h".

Depends on D131659

Remove unused FunctionBox methods to avoid having to include "vm/JSFunction.h".

Depends on D131660

Removes some additional unused methods.

Depends on D131661

If we move FixedSlotLimit from AbstractGeneratorObject into ParseContext,
we can avoid to include "vm/GeneratorObject.h" in "frontend/ParseContext.h".

Depends on D131662

Neither of two functions seem performance critical, so we can move them into
the cpp-file to avoid having to include "vm/BigIntType.h".

Depends on D131663

Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/263637629395
Part 1: Correct includes for frontend/SharedContext. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/a454384cbdb6
Part 2: Correct includes for frontend/ModuleSharedContext. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/731c556d4110
Part 3: Correct includes for frontend/AbstractScopePtr. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/ccd27cae868f
Part 4: Remove js_x_str uses in Opcodes.h. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/68388f6652c8
Part 5: Move JSOp enum into Opcodes.h. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/581db8281819
Part 6: Replace BytecodeUtil.h with Opcodes.h include. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/b4135ef21584
Part 7: Remove unnnecessary includes in js/src/frontend. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/a78731c989dc
Part 8: Move StaticStrings into its own file. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/f72d8e7d96a9
Part 9: Add explicit includes for "vm/StaticStrings.h". r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/aba817aaacfc
Part 10: Remove vm/StringType.h include from frontend/ParserAtom.h. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/5ac166a9c853
Part 11: Inline SetAliasedVarOperation. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/3578d15cb4fc
Part 12: Move MaybeCheckTDZ into TDZCheckCache. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/7f1eee7b3e96
Part 13: Remove unused function FireOnNewScripts. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/589909686118
Part 14: Remove unused FunctionBox methods. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/308ef0edc4fc
Part 15: Remove more unused methods. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/9be34d1d7801
Part 16: Move FixedSlotLimit to ParseContext. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/9dd268da9e6f
Part 17: Remove BigIntType.h includes from Stencil.h. r=tcampbell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: