File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -3916,26 +3916,26 @@ AC_SUBST(CARGO_BUILD_ARGS)dnl for selecting Rust build profiles
3916
3916
AC_SUBST ( YJIT_LIBS ) dnl for optionally building the Rust parts of YJIT
3917
3917
AC_SUBST ( YJIT_OBJ ) dnl for optionally building the C parts of YJIT
3918
3918
3919
- dnl Currently, RJIT only supports Unix x86_64 platforms.
3919
+ dnl RJIT supports only x86_64 platforms, but allows arm64/aarch64 for custom JITs .
3920
3920
RJIT_TARGET_OK=no
3921
3921
AS_IF ( [ test "$cross_compiling" = no] ,
3922
3922
AS_CASE ( [ "$target_cpu-$target_os"] ,
3923
3923
[ *android*] , [
3924
3924
RJIT_TARGET_OK=no
3925
3925
] ,
3926
- [ x86_64-darwin*] , [
3926
+ [ arm64-darwin*|aarch64-darwin*| x86_64-darwin*] , [
3927
3927
RJIT_TARGET_OK=yes
3928
3928
] ,
3929
- [ x86_64-*linux*] , [
3929
+ [ arm64-*linux*|aarch64-*linux*| x86_64-*linux*] , [
3930
3930
RJIT_TARGET_OK=yes
3931
3931
] ,
3932
- [ x86_64-*bsd*] , [
3932
+ [ arm64-*bsd*|aarch64-*bsd*| x86_64-*bsd*] , [
3933
3933
RJIT_TARGET_OK=yes
3934
3934
]
3935
3935
)
3936
3936
)
3937
3937
3938
- dnl Build RJIT on Unix x86_64 platforms or if --enable-rjit is specified.
3938
+ dnl Build RJIT on supported platforms or if --enable-rjit is specified.
3939
3939
AC_ARG_ENABLE ( rjit ,
3940
3940
AS_HELP_STRING ( [ --enable-rjit] ,
3941
3941
[ enable pure-Ruby JIT compiler. enabled by default on Unix x86_64 platforms] ) ,
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ def initialize
59
59
# @param iseq `RubyVM::RJIT::CPointer::Struct_rb_iseq_t`
60
60
# @param cfp `RubyVM::RJIT::CPointer::Struct_rb_control_frame_t`
61
61
def compile ( iseq , cfp )
62
+ return unless supported_platform?
62
63
pc = cfp . pc . to_i
63
64
jit = JITState . new ( iseq :, cfp :)
64
65
asm = Assembler . new
@@ -505,5 +506,12 @@ def assert(cond)
505
506
raise "'#{ cond . inspect } ' was not true"
506
507
end
507
508
end
509
+
510
+ def supported_platform?
511
+ return @supported_platform if defined? ( @supported_platform )
512
+ @supported_platform = RUBY_PLATFORM . match? ( /x86_64/ ) . tap do |supported |
513
+ warn "warning: RJIT does not support #{ RUBY_PLATFORM } yet" unless supported
514
+ end
515
+ end
508
516
end
509
517
end
You can’t perform that action at this time.
0 commit comments