Skip to content

sstangl/iongraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published