blob: 386a5a6f1efd53b451fb6d688e72e7ad5c62f31f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
require 'rbconfig'
module JITSupport
module_function
def yjit_supported?
return @yjit_supported if defined?(@yjit_supported)
# nil in mswin
@yjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['YJIT_SUPPORT'])
end
def yjit_enabled?
defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
end
def yjit_force_enabled?
"#{RbConfig::CONFIG['CFLAGS']} #{RbConfig::CONFIG['CPPFLAGS']}".match?(/(\A|\s)-D ?YJIT_FORCE_ENABLE\b/)
end
def zjit_supported?
return @zjit_supported if defined?(@zjit_supported)
# nil in mswin
@zjit_supported = ![nil, 'no'].include?(RbConfig::CONFIG['ZJIT_SUPPORT'])
end
def zjit_enabled?
defined?(RubyVM::ZJIT) && RubyVM::ZJIT.enabled?
end
end
|