[DOC] YJIT: Add YJIT to autolink_excluded_words

This commit is contained in:
Stan Lo 2025-08-11 22:27:27 +01:00 committed by Alan Wu
parent 39effad486
commit 4da569b53e
2 changed files with 6 additions and 5 deletions

View file

@ -20,5 +20,6 @@ autolink_excluded_words:
- Ruby - Ruby
- Set - Set
- ZJIT - ZJIT
- YJIT
canonical_root: https://docs.ruby-lang.org/en/master canonical_root: https://docs.ruby-lang.org/en/master

10
yjit.rb
View file

@ -1,14 +1,14 @@
# frozen_string_literal: true # frozen_string_literal: true
# :markup: markdown # :markup: markdown
# This module allows for introspection of \YJIT, CRuby's just-in-time compiler. # This module allows for introspection of YJIT, CRuby's just-in-time compiler.
# Everything in the module is highly implementation specific and the API might # Everything in the module is highly implementation specific and the API might
# be less stable compared to the standard library. # be less stable compared to the standard library.
# #
# This module may not exist if \YJIT does not support the particular platform # This module may not exist if YJIT does not support the particular platform
# for which CRuby is built. # for which CRuby is built.
module RubyVM::YJIT module RubyVM::YJIT
# Check if \YJIT is enabled. # Check if YJIT is enabled.
def self.enabled? def self.enabled?
Primitive.cexpr! 'RBOOL(rb_yjit_enabled_p)' Primitive.cexpr! 'RBOOL(rb_yjit_enabled_p)'
end end
@ -33,8 +33,8 @@ module RubyVM::YJIT
Primitive.rb_yjit_reset_stats_bang Primitive.rb_yjit_reset_stats_bang
end end
# Enable \YJIT compilation. `stats` option decides whether to enable \YJIT stats or not. `log` decides # Enable YJIT compilation. `stats` option decides whether to enable YJIT stats or not. `log` decides
# whether to enable \YJIT compilation logging or not. Optional `mem_size` and `call_threshold` can be # whether to enable YJIT compilation logging or not. Optional `mem_size` and `call_threshold` can be
# provided to override default configuration. # provided to override default configuration.
# #
# * `stats`: # * `stats`: