Module: RubyVM::ZJIT
Relationships & Source Files | |
Defined in: | zjit.rb |
Overview
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 Method Summary
-
.stats
Return ZJIT statistics as a
::Hash
. -
.stats_string
Get the summary of
ZJIT
statistics as a::String
. -
.assert_compiles
Internal use only
Assert that any future
ZJIT
compilation will return a function pointer. -
.print_stats
private
Internal use only
Print ZJIT stats.
Class Method Details
.assert_compiles
This method is for internal use only.
Assert that any future ZJIT
compilation will return a function pointer
# File 'zjit.rb', line 50
def assert_compiles # :nodoc: Primitive.rb_zjit_assert_compiles end
.print_stats (private)
This method is for internal use only.
Print ZJIT stats
# File 'zjit.rb', line 58
def print_stats $stderr.write stats_string end
.stats
Return ZJIT statistics as a ::Hash
# File 'zjit.rb', line 18
def stats stats = Primitive.rb_zjit_stats if stats.key?(:vm_insns_count) && stats.key?(:zjit_insns_count) stats[:total_insns_count] = stats[:vm_insns_count] + stats[:zjit_insns_count] stats[:ratio_in_zjit] = 100.0 * stats[:zjit_insns_count] / stats[:total_insns_count] end stats end
.stats_string
Get the summary of ZJIT
statistics as a ::String