Module

This module allows for introspection of ZJIT, CRuby’s just-in-time compiler. Everything in the module is highly implementation specific and the API might be less stable compared to the standard library.

This module may not exist if ZJIT does not support the particular platform for which CRuby is built.

Class Methods

Marshal dumps exit locations to the given filename.

Usage:

In a script call:

RubyVM::ZJIT.dump_exit_locations("my_file.dump")

Then run the file with the following options:

ruby --zjit --zjit-stats --zjit-trace-exits test.rb

Once the code is done running, use Stackprof to read the dump file. See Stackprof documentation for options.

Enable ZJIT compilation.

Check if ZJIT is enabled

If –zjit-trace-exits is enabled parse the hashes from Primitive.rb_zjit_get_exit_locations into a format readable by Stackprof. This will allow us to find the exact location of a side exit in ZJIT based on the instruction that is exiting.

Discard statistics collected for ‘–zjit-stats`.

Return ZJIT statistics as a Hash

Check if ‘–zjit-stats` is used

Get the summary of ZJIT statistics as a String

Check if ‘–zjit-trace-exits` is used