Side-exit on cfunc with -2 argc

This commit is contained in:
Takashi Kokubun 2023-02-14 23:44:44 -08:00
Родитель 4d97f9319c
Коммит 4271927d61
3 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1731,6 +1731,10 @@ module RubyVM::MJIT
asm.incr_counter(:send_arity)
return CantCompile
end
if cfunc.argc == -2
asm.incr_counter(:send_cfunc_ruby_array_varg)
return CantCompile
end
# Check interrupts before SP motion to safely side-exit with the original SP.
jit_check_ints(jit, ctx, asm)

Просмотреть файл

@ -135,6 +135,7 @@ MJIT_RUNTIME_COUNTERS(
send_cfunc_variadic,
send_cfunc_too_many_args,
send_cfunc_ruby_array_varg,
send_ivar,
send_ivar_splat,

Просмотреть файл

@ -1061,6 +1061,7 @@ module RubyVM::MJIT # :nodoc: all
send_iseq_kw_splat: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_iseq_kw_splat)")],
send_cfunc_variadic: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_cfunc_variadic)")],
send_cfunc_too_many_args: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_cfunc_too_many_args)")],
send_cfunc_ruby_array_varg: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_cfunc_ruby_array_varg)")],
send_ivar: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_ivar)")],
send_ivar_splat: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_ivar_splat)")],
send_ivar_opt_send: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_mjit_runtime_counters *)NULL)), send_ivar_opt_send)")],