ruby/rjit.rb

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

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

2023-03-07 10:15:30 +03:00
module RubyVM::RJIT
# Return true if RJIT is enabled.
def self.enabled?
Primitive.cexpr! 'RBOOL(rb_rjit_enabled)'
end
# Stop generating JITed code.
2023-03-08 10:44:26 +03:00
def self.pause
# TODO: implement this
end
# Start generating JITed code again after pause.
def self.resume
2023-03-08 10:44:26 +03:00
# TODO: implement this
end
2023-03-07 10:17:25 +03:00
if Primitive.rjit_stats_enabled_p
2023-02-07 11:00:09 +03:00
at_exit do
2023-03-07 10:17:25 +03:00
Primitive.rjit_stop_stats
2023-02-07 11:00:09 +03:00
print_stats
end
end
end
2023-03-07 10:15:30 +03:00
if RubyVM::RJIT.enabled?
begin
require 'fiddle'
require 'fiddle/import'
rescue LoadError
2023-03-07 10:15:30 +03:00
return # miniruby doesn't support RJIT
end
2023-03-07 10:17:25 +03:00
require 'ruby_vm/rjit/c_type'
require 'ruby_vm/rjit/compiler'
require 'ruby_vm/rjit/hooks'
require 'ruby_vm/rjit/stats'
end