class method
ZJIT.dump_exit_locations
dump_exit_locations(filename)
zjit.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/zjit.rb, line 140
def dump_exit_locations(filename)
unless trace_exit_locations_enabled?
raise ArgumentError, "--zjit-trace-exits must be enabled to use dump_exit_locations."
end
File.open(filename, "wb") do |file|
Marshal.dump(RubyVM::ZJIT.exit_locations, file)
file.size
end
end
Marshal dumps exit locations to the given filename.
Usage:
In a script call:
Example
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.