pypy / pypy / doc / jit-hooks.rst

JIT hooks

There are several hooks in the pypyjit module that may help you with understanding what's pypy's JIT doing while running your program. There are three functions related to that coming from the pypyjit module:

A class describing current snapshot. Usable attributes:

  • counters - internal JIT integer counters
  • counter_times - internal JIT float counters, notably time spent TRACING and in the JIT BACKEND
  • loop_run_times - counters for number of times loops are run, only works when enable_debug is called.

A class containing information about the compiled loop. Usable attributes:

  • operations - list of operations, if requested
  • jitdriver_name - the name of jitdriver associated with this loop
  • greenkey - a key at which the loop got compiled (e.g. code position, is_being_profiled, pycode tuple for python jitdriver)
  • loop_no - loop cardinal number
  • bridge_no - id of the fail descr
  • type - "entry bridge", "loop" or "bridge"
  • asmaddr - an address in raw memory where assembler resides
  • asmlen - length of raw memory with assembler associated