Closed Bug 1669181 Opened 4 years ago Closed 3 years ago

Clean-up jit headers

Categories

(Core :: JavaScript Engine: JIT, task, P1)

task

Tracking

()

RESOLVED FIXED
Tracking Status
firefox83 --- affected

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(73 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
(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
(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
(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
(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
(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
(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
(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
(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
(deleted), text/x-phabricator-request
Details

Clean-up jit headers by:

  • Remove unnecessary includes resp. replace includes with forward declarations.
  • Resolve transitive includes.
  • Disentangle VM headers from jit headers.
  • Split up headers with disjunctive dependencies.

"jit/BitSet.h" can forward declare TempAllocator instead of including
"jit/JitAllocPolicy.h".

Also adds missing includes to BitSet.h and BitSet.cpp.

"jit/BytecodeAnalysis.h" doesn't need to be included in these files.

Depends on D92384

Replace includes with forward declarations in "jit/Bailouts.h".

Depends on D92385

Moves most includes from "BaselineDebugModeOSR.h" into its cpp file.

Depends on D92386

These structs are only needed within "VMFunctions.cpp". Moving them will
allow to reduce the includes in "VMFunctions.h" in a later patch.

Depends on D92387

Use sizeof... from C++17 instead of manually counting the template parameters.

Depends on D92388

AutoDetectInvalidation needs to include "jit/IonScript.h". And because
"jit/IonScript.h" has many (transitive) includes, everyone including
"jit/VMFunctions.h" (e.g. "jit/MacroAssembler.h") ends up with a large include
list.

Depends on D92389

Additional changes needed:

jit/IonScript.h:

  • Include "gc/Barrier.h" for HeapPtrJitCode, HeapPtrObject, PreBarrieredValue.

jit/Sink.cpp:

  • Include "jit/IonOptimizationLevels.h" for jit::OptimizationInfo.

vm/JSScript-inl.h and vm/TypeInference-inl.h:

  • Include "jit/IonScript.h" for jit::IonScript.

wasm/WasmIonCompile.cpp:

  • Include "jit/IonOptimizationLevels.h" for jit::OptimizationLevel and jit::IonOptimizations.

Additional clean-up for missing/extra "jit/VMFunctions.h" includes:

jit/CacheIRCompiler.cpp and jit/IonIC.cpp:

  • Call various functions defined in "jit/VMFunctions.h".

jit/JSJitFrameIter.cpp:

  • Add "jit/VMFunctions.h" because jit::VMFunctionData methods are called.

jit/MIR.cpp:

  • Calls GetIndexFromString which is defined in "jit/VMFunctions.h".

jit/shared/CodeGenerator-shared.h:

  • Doesn't need to include "jit/VMFunctions.h".

vm/RegExpObject.cpp:

  • Doesn't need to include "jit/VMFunctions.h".

Depends on D92390

Forward declare TempAllocator instead of including "jit/JitAllocPolicy.h".

Depends on D92394

Attachment #9179534 - Attachment description: Bug 1669181 - Part 3: Clean-up includes in jit/BaselineDebugModeOSR.h. r=jandem! → Bug 1669181 - Part 4: Clean-up includes in jit/BaselineDebugModeOSR.h. r=jandem!

mozilla/Assertions.h:

  • For MOZ_ASSERT.

mozilla/Likely.h:

  • For MOZ_LIKELY and MOZ_UNLIKELY.

mozilla/TemplateLib.h:

  • For mozilla::tl::MulOverflowMask.

stddef.h:

  • For size_t.

string.h:

  • For memset and memcpy.

js/Utility.h:

  • For ShouldFailWithOOM, CalculateAllocSize, and JS_OOM_POSSIBLY_FAIL_BOOL.

AutoJitContextAlloc requires to include "vm/JSContext.h", so if we split it
from "jit/JitAllocPolicy.h", headers including "jit/JitAllocPolicy.h" no longer
also include "vm/JSContext.h" (and all its dependencies).

Additional changes needed:

irregexp/RegExpShim.h:

  • Include "vm/JSContext.h" to call JSContext::hasPendingInterrupt().
  • Add missing js qualifiers for CheckRecursionLimitDontReport. (Not sure how this even worked before.)

jit/BaselineJIT.h:

  • Include "jit/JitContext.h" for MethodStatus and JitExecStatus.

jit/Safepoints.h:

  • Add missing forward declaration for SafepointIndex.

jit/ValueNumbering.h:

  • Include "js/Vector.h" for js::Vector.

jit/WarpSnapshot.h:

  • Add missing forward declarations for ArgumentsObject, CallObject, and LexicalEnvironmentObject.

shared/Assembler-shared.h:

  • Include "jit/JitContext.h" for GetJitContext().
  • Add missing forward declaration for FrameType.

Depends on D92417

Forward declare {Native}TemplateObject instead of including the header.

Additional changes needed:

jit/CacheIRCompiler.cpp:

  • Add missing include for "jit/TemplateObject.h".

Depends on D92418

This struct is no longer used.

Depends on D92419

Replace the JSContext* parameter with LifoAlloc* so we don't need to
include "vm/JSContext.h" in "AutoJitContextAlloc.h", where it ends up including
"vm/JSContext.h" in "MacroAssembler.h".

With this change "MacroAssembler.h" no longer (transitively) includes "vm/JSContext.h"!

Depends on D92420

Depends on D92421

Remove unnecessary includes to "jit/Linker.h".

Depends on D92422

AutoWritableJitCode requires to access JSContext, so if we split it from
"jit/JitRealm.h", we can avoid another "vm/JSContext.h" dependency in an often
included jit header.

Depends on D92423

The comment no longer applies after the refactoring from bug 1407607.

Depends on D92424

EnterJitData is nowadays only used in "jit/BaselineJIT.cpp".

Depends on D92425

Fully qualifies JS::Zone to avoid pulling in "NamespaceImports.h".

GeckoProfilerRuntime is used within "jit/MIRGenerator.h", which in turn is
included in many places. Therefore let's reduce and clean-up the includes for
"vm/GeckoProfiler.h", so that "jit/MIRGenerator.h" has a smaller footprint.

Fully qualifies JS::UniqueChars to avoid pulling in "NamespaceImports.h".

Note:
"jit/MIRGenerator.h" currently indirectly includes GeckoProfilerRuntime
through "vm/JSContext.h" -> "vm/Runtime.h".

Depends on D92567

Additional changes needed:

jit/IonCompileTask.h:

  • Add missing forward declaration of WarpSnapshot.

Depends on D92568

The MIRGenerator* arguments is no longer needed after the refactorings from
bug 1646378.

After removing the MIRGenerator* arguments, also remove the include for
"jit/MIRGenerator.h".

Depends on D92571

JitRuntime depends on "vm/Runtime.h", so when we split it from "jit/JitRealm.h",
headers including "jit/JitRealm.h" no longer transitively include all of
"vm/Runtime.h".

Depends on D92572

Move the access to JitRuntime::preBarrier() out of the header, so we don't
need to include "jit/JitRuntime.h", because that means also including the
whole of "vm/Runtime.h".

Additional changes needed:

jit/MacroAssembler.h:

  • Forward declare CompileZone.

jit/MacroAssembler-inl.h:

  • Include "jit/CompileWrappers.h" for CompileZone::addressOfNeedsIncrementalBarrier().

Depends on D92574

Similar to part 27, also split JitZone from "jit/JitRealm.h".

Depends on D92575

After part 27 and part 29, the necessary includes for "jit/JitRealm.h" are easier
to determine and a lot shorter.

Additional changes needed:

jit/IonBuilder.h

  • Include "builtin/TypedObject.h" for ScalarTypeDescr.

jit/MIR.h:

  • Include "jit/CompileInfo.h" for InlineScriptTree and BytecodeSite.

jit/MacroAssembler.h:

  • Move MacroAssembler::loadJitActivation() out-of-line, this function is only used for CHECK_OSIPOINT_REGISTERS.
  • Move MacroAssembler::loadTraceLogger() out-of-line, this function is only used for JS_TRACE_LOGGING.
  • (These two changes remove the "vm/JSContext.h" dependency from "jit/MacroAssembler.h".)

jit/none/MacroAssembler-none.h:

  • Forward declare CompactBufferReader.

jit/MacroAssembler-inl.h:

  • Include "jit/JitFrames.h" for FRAMESIZE_SHIFT, MakeFrameDescriptor, ExitFrame{Layout,Type}, ExitFooterFrame, and various CalleeToken constants.

jit/BaselineIC.h:

  • Forward declare ICScript.

jit/arm64/Assembler-arm64.h

  • Include "jit/CompactBuffer.h" for CompactBufferWriter.

irregexp/RegExpNativeMacroAssembler.cpp:

  • Include "vm/Realm.h" for Realm::ensureJitRealmExists.

wasm/WasmCode.h:

  • Include "gc/Memory.h" for gc::SystemPageSize().

wasm/WasmModule.h:

  • Forward declare JSTelemetrySender.
  • Include "wasm/WasmJS.h" for WasmTableObject, WasmGlobalObject, and WasmMemoryObject.
    • Needed for WasmTableObjectVector resp. WasmGlobalObjectVector.
    • WasmMemoryObject needed for ConvertToBase via TraceRoot.

wasm/WasmCompile.h:

  • Include "vm/Runtime.h" for JSTelemetrySender().

wasm/WasmCompile.cpp:

  • Include "vm/Realm.h" for Realm::debuggerObservesAsmJS().

wasm/WasmGenerator.cpp:

  • Include "vm/TraceLogging.h" for TraceLoggerForCurrentThread and AutoTraceLog.
  • Include "vm/TraceLoggingTypes.h" for TraceLogger_WasmCompilation.

Depends on D92576

Remove unnecessary resp. no longer needed includes to "jit/JitRealm.h" after
the refactorings from the last parts.

Additional changes needed:

  • And add "jit/JitRealm.h" includes in some places which previously only
    indirectly included it through "Assembler-<platform>.h".

Depends on D92577

The platform-specific assemblers no longer need to include "jit/JitFrames.h".

Additional changes needed:

jit/arm/Simulator-arm.cpp:

  • Include "vm/JSContext.h" for TlsContext.get().

JS::Handle and JS::HandleFunction were fully qualified to avoid pulling in
the "NamespaceImports.h" header.

Depends on D92624

Depends on D92626

Replace the "jit/BaselineFrame.h" includes in "SharedICHelpers-<platform>.h"
with includes to "jit/JitFrames.h" (for FRAMESIZE_SHIFT).

Additional changes needed:

jit/<platform>/SharedICHelpers-<platform>-inl.h:

  • Add missing "jit/BaselineFrame.h" include.

jit/<platform>/Trampoline-<platform>.cpp:

  • Add missing "jit/BaselineFrame.h" include.

jit/WarpBuilder.cpp:

  • Add missing "jit/BaselineFrame.h" include.

Also changed:

vm/Activation-inl.h

  • Remove unnecessary "jit/BaselineFrame.h" include.

Depends on D92628

Split CalleeTokenTag functions from "jit/JitFrames.h" into a new
"jit/CalleeToken.h" header. Also move CalleToken itself from
"jit/JSJitFrameIter.h" in the new header.

This avoids pulling in the other headers included in "jit/JitFrames.h" to
the users of CalleeToken{Tag}.

Also:

  • Remove the unused function CalleeTokenIsModuleScript.
  • ScriptFromCalleeToken stays in "jit/JitFrames.h" for now to avoid pulling
    in "vm/Script.h".

Additional changes needed:

vm/SavedFrame.h:

  • Include "vm/NativeObject.h" for NativeObject.

Depends on D92629

Replace the include with a forward declaration of InlineScriptTree.

Depends on D92630

"jit/MIR.h" needs to access InlineScriptTree and BytecodeSite. By splitting
both classes from "jit/CompileInfo.h" we can avoid pulling in the additional
headers from "jit/CompileInfo.h" into "jit/MIR.h". This is useful because
"jit/MIR.h" is (transitively) included in many other headers.

Depends on D92731

Non-exhaustive update to add missing includes and forward declarations. Also
removes two unnecessary includes.

Additional changes needed:

jit/BaselineDebugModeOSR.cpp

  • Include "jit/Ion.h" for jit::Invalidate().

jit/shared/CodeGenerator-shared.h:

  • Include "vm/TraceLoggingTypes.h" for TraceLoggerTextId.

jit/IonCompileTask.cpp:

  • Include "jit/Ion.h" for jit::CompileBackEnd() and jit::LinkIonScript().

wasm/WasmIonCompile.cpp:

  • Include "jit/Ion.h" for jit::CompileBackEnd() and jit::LinkIonScript().

Depends on D92732

SafepointIndex and OsiIndex only need a handful of dependencies, so split
them from the larger "jit/JitFrames.h" header.

Depends on D92733

Split ScriptFromCalleeToken from "jit/JitFrames.h" to avoid the dependency
on "vm/JSFunction.h".

Depends on D92734

GetTopJitJSScript() is only used in two files and never in performance
critical spots, so it's okay to move it out-of-line.

jit/BaselineIC.cpp:
Used in FallbackICSpew() and TypeFallbackICSpew() for jit-spew code.

jit/VMFunctions.cpp:
Used in the AutoDetectInvalidation constructor which is only called for
jit::ArrayPopDense() and jit::ArrayShiftDense(). These two functions are
Ion-only, so will likely be removed soon anyway.

Depends on D92738

With the refactorings from the last parts, the dependencies for
"jit/JitFrames.h" got a lot shorter.

Fully qualified JS::Value to avoid pulling in "NamespaceImports.h".

Additional changes needed:

jit/BaselineFrame.h:

  • Include "vm/JSContext.h" for JSContext::isProfilerSamplingEnabled().
  • Forward declare ICScript.

jit/CompileInfo.h:

  • Include "vm/Runtime.h" for JSAtomState::dotThis.

jit/MacroAssembler-inl.h:

  • Include "jit/JSJitFrameIter.h" for jit::FrameType::IonJS.
  • Include "vm/Runtime.h" for SelfHostedLazyScript::offsetOfWarmUpData().

wasm/WasmFrameIter.cpp:

  • Include "vm/JSContext.h" for JSContext::{clearPendingException, names, offsetOfActivation}().

Depends on D92739

"jit/JitFrames.h" was previously only transitively included in many
files. Add explicit includes for it.

Also: Remove unnecessary includes to "jit/JitFrames-inl.h".

Additional changes needed:

jit/BaselineFrame.cpp:

  • Include "jit/JSJitFrameIter-inl.h" for JSJitFrameIter::baselineFrameNumValueSlots().

jit/BaselineDebugModeOSR.cpp

  • Include "jit/JSJitFrameIter-inl.h" for JSJitFrameIter::baselineFrame()

Depends on D92740

The full definition of JSContext is only needed for assertions, let's move
that call out-of-line to remove the "vm/JSContext.h" dependency from
"jit/BaselineFrame.h".

Depends on D92741

Split JSAtomState from "vm/Runtime.h", so that "jit/CompileInfo.h" doesn't
need to pull in everything from "vm/Runtime.h".

Drive-by change:

  • Remove an unnecessary include from "vm/CommonPropertyNames.h".

Depends on D92742

Thank you for doing all this.

Pushed by rmaries@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/01a3baa8e147 Part 1: Clean-up includes for jit/BitSet.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/dce6529e0f33 Part 2: Remove unnecessary includes to "jit/BytecodeAnalysis.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/d63543e0c221 Part 3: Clean-up includes in jit/Bailouts.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/6021f6a2f27e Part 4: Clean-up includes in jit/BaselineDebugModeOSR.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/4b2527ba0c3c Part 5: Move structs out of VMFunctions.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/4f29aa40161b Part 6: Replace LastArg::nbArgs with sizeof... . r=jandem https://hg.mozilla.org/integration/autoland/rev/49f9610d942c Part 7: Split AutoDetectInvalidation from VMFunctions. r=jandem https://hg.mozilla.org/integration/autoland/rev/280b8e15e8bc Part 8: Clean-up VMFunctions.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/5717fc15036b Part 9: Remove no longer defined InitProp function. r=jandem https://hg.mozilla.org/integration/autoland/rev/a0db60623146 Part 10: Clean-up includes in jit/TypePolicy.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/9b8826d84317 Part 11: Add missing includes to jit/JitAllocPolicy.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/aa10bd2dc6aa Part 12: Split AutoJitContextAlloc from JitAllocPolicy.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/54886b085899 Part 13: Replace "jit/TemplateObject.h" include in MacroAssembler.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/95df626925e3 Part 14: Remove unused GlobalAccess struct. r=jandem https://hg.mozilla.org/integration/autoland/rev/627292c3738d Part 15: Remove JSContext dependency from AutoJitContextAlloc. r=jandem https://hg.mozilla.org/integration/autoland/rev/49f58c5c1e7f Part 16: Clean-up jit/Linker.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/773de361c88f Part 17: Remove includes to "jit/Linker.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/2a4bb44f9552 Part 18: Split AutoWritableJitCode from JitRealm.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/6ab91b5737ff Part 19: Remove a stale comment. r=jandem https://hg.mozilla.org/integration/autoland/rev/07d281263a39 Part 20: Move EnterJitData to its sole user. r=jandem https://hg.mozilla.org/integration/autoland/rev/4ec61fbf4682 Part 21: Clean-up jit/CompileWrappers.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/3c5df85dafd6 Part 22: Clean-up vm/GeckoProfiler.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/3e0a69ae8e2c Part 23: Clean-up jit/MIRGenerator.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/1a83865aa836 Part 24: Clean-up jit/EdgeCaseAnalysis.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/823fd9df4633 Part 25: Clean-up jit/EffectiveAddressAnalysis.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/3ce96e12918f Part 26: Remove unused MIRGenerator arguments from CallInfo methods. r=jandem https://hg.mozilla.org/integration/autoland/rev/974153fd8e3c Part 27: Split JitRuntime from jit/JitRealm.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/f9f61473d403 Part 28: Avoid JitRuntime.h include in MacroAssembler.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/dcc850077be2 Part 29: Split JitZone from jit/JitRealm.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/5fb82ae534ad Part 30: Clean-up "jit/JitRealm.h" includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/1a448c5dd199 Part 31: Remove unnecessary includes to jit/JitRealm.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/171163447e46 Part 32: Remove jit/JitFrames.h include from MacroAssembler-<platform>.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/a3d2eee0377e Part 33: Clean-up jit/FoldLinearArithConstants.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/f0183af2bdb9 Part 34: Clean-up jit/IonAnalysis.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/9f3b43ad95cc Part 35: Clean-up jit/RangeAnalysis.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/4d1ae9d2cbc9 Part 36: Clean jit/JitContext.cpp includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/9ee174395419 Part 37: Clean-up jit/CompactBuffer.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/6288ff53b88f Part 38: Clean-up includes to "jit/BaselineFrame.h" in SharedICHelpers headers. r=jandem https://hg.mozilla.org/integration/autoland/rev/70c94a537000 Part 39: Split CalleeTokenTag from jit/JitFrames.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/517ad8fc345a Part 40: Move "jit/CompileInfo.h" include in "jit/JitcodeMap.h" to the cpp file. r=jandem

https://hg.mozilla.org/mozilla-central/rev/01a3baa8e147
https://hg.mozilla.org/mozilla-central/rev/dce6529e0f33
https://hg.mozilla.org/mozilla-central/rev/d63543e0c221
https://hg.mozilla.org/mozilla-central/rev/6021f6a2f27e
https://hg.mozilla.org/mozilla-central/rev/4b2527ba0c3c
https://hg.mozilla.org/mozilla-central/rev/4f29aa40161b
https://hg.mozilla.org/mozilla-central/rev/49f9610d942c
https://hg.mozilla.org/mozilla-central/rev/280b8e15e8bc
https://hg.mozilla.org/mozilla-central/rev/5717fc15036b
https://hg.mozilla.org/mozilla-central/rev/a0db60623146
https://hg.mozilla.org/mozilla-central/rev/9b8826d84317
https://hg.mozilla.org/mozilla-central/rev/aa10bd2dc6aa
https://hg.mozilla.org/mozilla-central/rev/54886b085899
https://hg.mozilla.org/mozilla-central/rev/95df626925e3
https://hg.mozilla.org/mozilla-central/rev/627292c3738d
https://hg.mozilla.org/mozilla-central/rev/49f58c5c1e7f
https://hg.mozilla.org/mozilla-central/rev/773de361c88f
https://hg.mozilla.org/mozilla-central/rev/2a4bb44f9552
https://hg.mozilla.org/mozilla-central/rev/6ab91b5737ff
https://hg.mozilla.org/mozilla-central/rev/07d281263a39
https://hg.mozilla.org/mozilla-central/rev/4ec61fbf4682
https://hg.mozilla.org/mozilla-central/rev/3c5df85dafd6
https://hg.mozilla.org/mozilla-central/rev/3e0a69ae8e2c
https://hg.mozilla.org/mozilla-central/rev/1a83865aa836
https://hg.mozilla.org/mozilla-central/rev/823fd9df4633
https://hg.mozilla.org/mozilla-central/rev/3ce96e12918f
https://hg.mozilla.org/mozilla-central/rev/974153fd8e3c
https://hg.mozilla.org/mozilla-central/rev/f9f61473d403
https://hg.mozilla.org/mozilla-central/rev/dcc850077be2
https://hg.mozilla.org/mozilla-central/rev/5fb82ae534ad
https://hg.mozilla.org/mozilla-central/rev/1a448c5dd199
https://hg.mozilla.org/mozilla-central/rev/171163447e46
https://hg.mozilla.org/mozilla-central/rev/a3d2eee0377e
https://hg.mozilla.org/mozilla-central/rev/f0183af2bdb9
https://hg.mozilla.org/mozilla-central/rev/9f3b43ad95cc
https://hg.mozilla.org/mozilla-central/rev/4d1ae9d2cbc9
https://hg.mozilla.org/mozilla-central/rev/9ee174395419
https://hg.mozilla.org/mozilla-central/rev/6288ff53b88f
https://hg.mozilla.org/mozilla-central/rev/70c94a537000
https://hg.mozilla.org/mozilla-central/rev/517ad8fc345a

Additional changes needed:

Assembler-x86-shared.h:

  • Include "jit/CompactBuffer.h" for CompactBufferWriter.

Depends on D92914

Depends on D92916

Additional changes needed:

jit/BaselineFrame.h:

  • Forward declare JSJitFrameIter.

js/CacheIR.h:

  • Forward declare Register.

Depends on D92917

Additional changes needed:

jit/shared/Assembler-shared.h:

  • Include "jit/JitCode.h" for JitCode::{instructionsSize, raw}().

irregexp/RegExpShim.h:

  • Include "jit/JitCode.h" for JitCode::raw().

vm/RegExpShared.h:

  • Include "jit/JitCode.h" for WeakHeapPtr<jit::JitCode*>.

Depends on D92918

Depends on D92919

Additional changes needed:

jit/BaselineCodeGen.h:

  • Include "jit/MacroAssembler.h" for calling various MacroAssembler methods.

jit/CacheIRCompiler.h:

  • Include "jit/MacroAssembler.h" for StackMacroAssembler.

Depends on D92921

Depends on D92923

Severity: -- → N/A
Priority: -- → P1

Adds many headers which were previously only transitively included.

Additional changes needed:

jit/<platform>/MacroAssembler-<platform>.cpp

  • Include "vm/JSContext.h" for offsetof(JSContext, profilingActivation_).

jit/<platform>/Trampoline-<platform>.cpp

  • Include "vm/JSContext.h" for JSContext::runtime().

jit/RematerializedFrame.cpp:

  • Include "jit/Bailouts.h" for EnsureHasEnvironmentObjects().

vm/Initialization.cpp:

  • Include "vm/ArrayBufferObject.h" for LiveMappedBufferCount().

vm/TraceLogging.cpp

  • Include "vm/JSContext.h" for JSContext::{compartment,runtime}(), JSContext::traceLogger, and TlsContext.

Depends on D92951

Also removes the transitive include of "jsmath.h" through "vm/Caches.h", which
requires fix-ups in multiple files.

Additional changes needed:

frontend/FoldConstants.cpp:

  • Include "jsmath.h" for ecmaPow().

jit/CacheIR.cpp:

  • Include "jsmath.h" for UnaryMathFunction::*.

jit/<platform>/MacroAssembler-<platform>.cpp:

  • Include "jsmath.h" for GetBiggestNumberLessThan().

vm/Interpreter.cpp:

  • Include "jsmath.h" for ecmaPow().

vm/SelfHosting.cpp:

  • Include "jsmath.h" for various math functions.

wasm/WasmBuiltins.cpp:

  • Include "jsmath.h" for various math functions.

wasm/WasmInstance.cpp:

  • Include "jsmath.h" for RoundFloat32.

Depends on D92953

Remove the "builtin/TypedObject.h" include from "jit/CacheIR.h", because it
leads to including many unrelated headers.

  • Move SimpleTypeDescrKey() into "CacheIR.cpp", because it's only called
    within that file.
  • Use Scalar::Type for ScalarTypeFromSimpleTypeDescrKey(), because then we
    don't need to include the definition of ScalarTypeDescr. All callers of
    ScalarTypeFromSimpleTypeDescrKey() are even already using Scalar::Type!

Additional changes needed:

jit/CacheIR.h:

  • Include "js/experimental/JitInfo.h" for JitInfo::type().
  • Include "vm/JSFunction.h" for JSFunction::flags().
  • Forward declare JSOp, ReferenceType, and IsTypedObjectClass().

jit/Simulator.h:

  • Add the typedef for jit::Simulator, because some files are no longer
    transitively including "vm/Runtime.h", where the same typedef is also
    defined.

jit/TrialInlining.h

  • Forward declare BaselineFrame.

Depends on D92955

Let's consistenly use "jit/Simulator.h" to include the Simulator headers.

Depends on D92956

Split uint8_clamped from "vm/ArrayBufferObject.h" so that
"AtomicOperations-shared-jit.h" no longer needs to include all headers from
"vm/ArrayBufferObject.h".

Depends on D92957

"jit/shared/Assembler-shared.h" includes "wasm/WasmTypes.h", which in turn
includes "vm/JSFunction.h", and that means we also end up including:

  • "vm/JSObject.h"
  • "vm/NativeObject.h"
  • "vm/ObjectGroup.h"
  • "vm/StringType.h"
  • and many other headers.

Make some of these includes more obvious, so we don't only rely on transitive
includes.

jit/Lowering.cpp:

  • Include "wasm/WasmTypes.h" for wasm::TlsData and wasm::CalleeDesc.

jit/MacroAssembler.cpp:

  • Include "wasm/WasmTypes.h" for wasm::TlsData, wasm::BytecodeOffset, etc.

jit/MacroAssembler.h:

  • Include "vm/BytecodeUtil.h" for JSOp.
  • Include "vm/FunctionFlags.h" for FunctionFlags::FunctionKind.
  • Include "vm/JSObject.h" for JSObject::offsetOfGroup().
  • Include "vm/ObjectGroup.h" for ObjectGroup::offsetOf{Clasp,Proto}().
  • Include "vm/StringType.h" for JSString::offsetOfLength().
  • Forward declare various js::TypeSet and wasm types.

jit/<platform>/Assembler-<platform>.h:

  • Include "wasm/WasmTypes.h" for wasm::Bytes.

jit/<platform>/MacroAssembler-<platform>.h:

  • Include "wasm/WasmTypes.h" for wasm::TlsData.

jit/shared/Assembler-shared.h:

  • Include "gc/Barrier.h" for CurrentThreadIsIonCompilingSafeForMinorGC().
  • Include "vm/NativeObject.h" for NativeObject::{elements,slots}SizeMustNotOverflow().

jit/x86/CodeGenerator-x86.cpp:

  • Include "wasm/WasmTypes.h" for wasm::TlsData and wasm::MaxOffsetGuardLimit.

Depends on D92960

Fully qualifies JS::Value to avoid including "NamespaceImports.h".

Depends on D92962

Lando could not land your changes. Please rebase your patches.

Pushed by ncsoregi@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/660832494151 Part 41: Clean-up jit/FixedList.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/6c8bb7f72d26 Part 42: Split InlineScriptTree and BytecodeSite from "jit/CompileInfo.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/0fe6ce4c4f15 Part 43: Add missing includes and forward declarations in "jit/MIR.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/1dba370382e2 Part 44: Split SafepointIndex and OsiIndex from "jit/JitFrames.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/43f034de6590 Part 45: Split ScriptFromCalleeToken from "jit/JitFrames.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/216e75704aed Part 46: Un-inline GetTopJitJSScript. r=jandem https://hg.mozilla.org/integration/autoland/rev/1adb2619f5dc Part 47: Clean-up jit/JitFrames.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/c37a8a0e61e8 Part 48: Add missing includes to "jit/JitFrames.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/662cc0fae382 Part 49: Remove "vm/JSContext.h" dependency from "jit/BaselineFrame.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/6c44eb7c828d Part 50: Split JSAtomState from "vm/Runtime.h". r=jandem https://hg.mozilla.org/integration/autoland/rev/83e920017fc6 Part 51: Clean-up jit/x86-shared/AssemblerBuffer-x86-shared.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/ea0c4efccf89 Part 52: Clean-up jit/JitSpewer.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/822b8a28a761 Part 53: Clean-up jit/JitCode.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/f270cf5ea749 Part 54: Remove JSJitFrameIter.h include from vm/Stack.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/2fe862adb763 Part 55: Remove JitCode.h include from vm/Script.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/4354437b3bd5 Part 56: Clean-up jit/Safepoints.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/30b8c9bc509e Part 57: Clean-up MoveEmitter-<platform>.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/2ea065fc4d80 Part 58: Clean-up SharedICRegisters-<platform>.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/edd577678e82 Part 59: Clean-up jit/RematerializedFrame.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/c6cf76fdeae5 Part 60: Clean-up jit/Jit.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/8f08c9034b90 Part 61: Clean-up jit/Ion.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/2b6b416c7d96 Part 62: Clean-up jit/BaselineJIT.h includes. r=jandem
Pushed by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1d0b6a969d8e Part 63: Remove jsmath.h and vm/Iteration.h includes from CacheIR.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/592718e440ea Part 64: Remove TypedObject.h include from CacheIR.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/c1ec475a66d7 Part 65: Use jit/Simulator.h to include Simulator headers. r=jandem https://hg.mozilla.org/integration/autoland/rev/1297ab579050 Part 66: Split uint8_clamped from vm/ArrayBufferObject.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/1d67bea50176 Part 67: Clean-up jit/shared/AtomicOperations-shared-jit.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/7c5145890d2a Part 68: Add some explicit includes to avoid relying only on transitive includes through WasmTypes.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/5ae9ad434f9d Part 69: Clean-up jit/WarpBuilderShared.h includes. r=jandem https://hg.mozilla.org/integration/autoland/rev/b7edb792eff7 Part 70: Clean-up jit/WarpCacheIRTranspiler.h includes. r=jandem

https://hg.mozilla.org/integration/autoland/revb7edb792eff7
Part 70: Clean-up jit/WarpCacheIRTranspiler.h includes. r=jandem
https://hg.mozilla.org/integration/autoland/rev5ae9ad434f9d
Part 69: Clean-up jit/WarpBuilderShared.h includes. r=jandem
https://hg.mozilla.org/integration/autoland/rev7c5145890d2a
Part 68: Add some explicit includes to avoid relying only on transitive includes through WasmTypes.h. r=jandem
https://hg.mozilla.org/integration/autoland/rev1d67bea50176
Part 67: Clean-up jit/shared/AtomicOperations-shared-jit.h includes. r=jandem
https://hg.mozilla.org/integration/autoland/rev1297ab579050
Part 66: Split uint8_clamped from vm/ArrayBufferObject.h. r=jandem
https://hg.mozilla.org/integration/autoland/revc1ec475a66d7
Part 65: Use jit/Simulator.h to include Simulator headers. r=jandem
https://hg.mozilla.org/integration/autoland/rev592718e440ea
Part 64: Remove TypedObject.h include from CacheIR.h. r=jandem
https://hg.mozilla.org/integration/autoland/rev1d0b6a969d8e
Part 63: Remove jsmath.h and vm/Iteration.h includes from CacheIR.h. r=jandem

https://hg.mozilla.org/mozilla-central/rev/660832494151
https://hg.mozilla.org/mozilla-central/rev/6c8bb7f72d26
https://hg.mozilla.org/mozilla-central/rev/0fe6ce4c4f15
https://hg.mozilla.org/mozilla-central/rev/1dba370382e2
https://hg.mozilla.org/mozilla-central/rev/43f034de6590
https://hg.mozilla.org/mozilla-central/rev/216e75704aed
https://hg.mozilla.org/mozilla-central/rev/1adb2619f5dc
https://hg.mozilla.org/mozilla-central/rev/c37a8a0e61e8
https://hg.mozilla.org/mozilla-central/rev/662cc0fae382
https://hg.mozilla.org/mozilla-central/rev/6c44eb7c828d
https://hg.mozilla.org/mozilla-central/rev/83e920017fc6
https://hg.mozilla.org/mozilla-central/rev/ea0c4efccf89
https://hg.mozilla.org/mozilla-central/rev/822b8a28a761
https://hg.mozilla.org/mozilla-central/rev/f270cf5ea749
https://hg.mozilla.org/mozilla-central/rev/2fe862adb763
https://hg.mozilla.org/mozilla-central/rev/4354437b3bd5
https://hg.mozilla.org/mozilla-central/rev/30b8c9bc509e
https://hg.mozilla.org/mozilla-central/rev/2ea065fc4d80
https://hg.mozilla.org/mozilla-central/rev/edd577678e82
https://hg.mozilla.org/mozilla-central/rev/c6cf76fdeae5
https://hg.mozilla.org/mozilla-central/rev/8f08c9034b90
https://hg.mozilla.org/mozilla-central/rev/2b6b416c7d96
https://hg.mozilla.org/mozilla-central/rev/1d0b6a969d8e
https://hg.mozilla.org/mozilla-central/rev/592718e440ea
https://hg.mozilla.org/mozilla-central/rev/c1ec475a66d7
https://hg.mozilla.org/mozilla-central/rev/1297ab579050
https://hg.mozilla.org/mozilla-central/rev/1d67bea50176
https://hg.mozilla.org/mozilla-central/rev/7c5145890d2a
https://hg.mozilla.org/mozilla-central/rev/5ae9ad434f9d
https://hg.mozilla.org/mozilla-central/rev/b7edb792eff7

Regressions: 1670643
No longer regressions: 1670643
Regressions: 1671534

"mozilla/Attributes.h" was previously only included for MOZ_MUST_USE, so we no
longer need the include after switching to use [[nodiscard]].

Also add the missing include for "mozilla/XorShift128PlusRNG.h" to "vm/Runtime.h".

Depends on D103669

Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/057a85efbbe7 Part 71: Remove no longer needed includes to mozilla/Attributes.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/3c64a2d8fb90 Part 72: Remove unused includes and forward declarations from jit/ExecutableAllocator.h. r=jandem https://hg.mozilla.org/integration/autoland/rev/39ba7707f160 Part 73: Replace an include with a forward declaration in jit/InlinableNatives.h. r=jandem

Sounds like this work ended 5 months ago?
Otherwise, maybe we should open a new bug.

Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: