Closed Bug 1686658 Opened 4 years ago Closed 4 years ago

Tidy up debug output with IONFLAGS=, especially IONFLAGS=all

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: jseward, Assigned: jseward)

Details

Attachments

(1 file)

Output with IONFLAGS=all is valuable for debugging the various JITs, but is
inconsistent and poorly sectioned, at least for the output generated when the
input is wasm and the selected compiler is Ion. This patch makes some
improvements. There is no functional change for non-debug builds. The
changes make it easier to navigate through large amounts of debug output.

Output with IONFLAGS=all is valuable for debugging the various JITs, but is
inconsistent and poorly sectioned, at least for the output generated when the
input is wasm and the selected compiler is Ion. This patch makes some
improvements. There is no functional change for non-debug builds. The
changes make it easier to navigate through large amounts of debug output.
Changes are:

  • For debug printing caused by MIR optimisation (meaning, as driven by
    OptimizeMIR()), by the code generator, and by the register allocator:
    route all output by the official JitSpew family of calls, instead of an
    ad-hoc mixture of JitSpew calls and lower level printfs. This causes
    all such output to be properly prefixed with a [SomePass] style marker.
    Most of these changes are in the register allocator.

  • For the debug printing caused by OptimizeMIR():

    • print a blank line before the output of each pass, so as to make it easier
      to identify the start and end of debug output for each pass. No blank
      line is emitted for passes which don't create debug output (meaning, which
      don't have their own JitSpew_SomePass selector.

    • Ensure that every pass which is run, that can emit debug output and which
      is enabled by the IONFLAGS= setting, does actually print at least one
      line, even if it is just a [SomePass] Begin message, so we can know that
      the pass actually ran. Without this, it's impossible to differentiate the
      cases "pass ran, but produced no debug output" from "pass didn't run",
      when reading debug output.

    • for the debug printing for the Range analysis pass, add some missing
      newlines.

    • In various places, add a bit of indentation so as to clarify the logical
      nesting structure of the debug output.

  • In the register allocator, fine-tune the placement of blank lines so as to
    clarify the start/end of sub-phases, and convert many ad-hoc out.printf
    calls to official JitSpew calls.

  • In wasm::IonCompileFunctions(), make the function start/end logging lines
    much longer, so as to make it easier to find them in large log files.

  • js/src/jit/JitSpewer.h: new entry WasmBCE, for wasm bounds-check
    elimination logging.

Assignee: nobody → jseward
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P1
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9120167d57bd Tidy up debug output with IONFLAGS=, especially IONFLAGS=all. r=jandem.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: