ruby/mjit.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 строки
586 B
Ruby
Исходник Обычный вид История

module RubyVM::MJIT
# Return true if MJIT is enabled.
def self.enabled?
Primitive.cexpr! 'RBOOL(mjit_enabled)'
end
# Stop generating JITed code.
def self.pause(wait: true)
Primitive.cexpr! 'mjit_pause(RTEST(wait))'
end
# Start generating JITed code again after pause.
def self.resume
Primitive.cexpr! 'mjit_resume()'
end
end
if RubyVM::MJIT.enabled?
begin
require 'fiddle'
require 'fiddle/import'
rescue LoadError
return # miniruby doesn't support MJIT
end
2022-12-12 08:42:25 +03:00
require 'mjit/c_type'
require 'mjit/compiler'
2022-12-27 09:46:40 +03:00
require 'mjit/stats'
end