mirror of
https://github.com/ruby/ruby.git
synced 2026-08-16 02:15:57 +08:00
13 lines
369 B
Ruby
13 lines
369 B
Ruby
class Module
|
|
# Internal helper for built-in initializations to define methods only when JIT is enabled.
|
|
# This method is removed in jit_undef.rb.
|
|
private def with_jit(&block) # :nodoc:
|
|
if defined?(RubyVM::ZJIT)
|
|
RubyVM::ZJIT.send(:add_jit_hook, block)
|
|
end
|
|
if defined?(RubyVM::YJIT)
|
|
RubyVM::YJIT.send(:add_jit_hook, block)
|
|
end
|
|
end
|
|
end
|