sstangl / iongraph

Visualize IonMonkey CFGs using GraphViz.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

  Primitive visualizer for IonMonkey graphs using GraphViz.
  Doesn't involve Java. Generated images and DOT files are saved on disk.

  Copyright Sean Stangl <sstangl@mozilla.com>, 2011-2012.

IONMONKEY

  IonMonkey is a compiler for JavaScript that uses an SSA-form IR.

  Mozilla-Central (https://hg.mozilla.org/mozilla-central) includes IonMonkey
  as part of the SpiderMonkey JavaScript engine in js/src.

USAGE

  Make a debug build of IonMonkey, then run with the envvar IONFLAGS=logs.
  IonMonkey will then dump observations about graph state into /tmp/ion.json.

  IMPORTANT:
    IonMonkey by default uses background threads for compilation, but the
    JitSpewer, the thing that outputs ion.json, was never updated to work
    with threads, so by default ion.json contains blank data.

    You can work around this by passing --ion-offthread-compile=off.
    If using jit-tests, this looks like:

      python jit-tests/jit-tests.py path/to/shell.js --args="--ion-offthread-compile=off"

    If you want to write the support for parallel ion.json generation,
    message sstangl on irc.mozilla.org/#jsapi.

  Executing 'make' reads in this file, outputs a DOT file for each function
  and for each pass for each function, and then generates visualizations
  of those DOT files in PNG and PDF format.

  Iterating over those files crudely shows changes to the graph over time.

GRAPH PROPERTIES

  Blocks with green borders are loop headers.
  Blocks with red borders contain loop backedges (successor is a header).
  Blocks with dashed borders were created during critical edge splitting.

  Instructions that are movable are blue.
  Instructions that cannot be hoisted even if movable are underlined.

  MResumePoints are placed as instructions, colored gray.

  Edges from blocks ending with conditional branches are annotated with
    the truth value associated with each edge, given as '0' or '1'.

About

Visualize IonMonkey CFGs using GraphViz.

License:MIT License


Languages

Language:Python 89.4%Language:Shell 7.9%Language:Makefile 2.7%