YJIT: Add splat optimized_send (#7167)

This commit is contained in:
Jimmy Miller 2023-01-30 15:54:09 -05:00 committed by GitHub
parent b32e1169c9
commit 07d1b3ddc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2023-01-30 20:54:29 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>
2 changed files with 11 additions and 11 deletions

View File

@ -4750,11 +4750,6 @@ fn gen_send_cfunc(
}
}
// This is a .send call and we need to adjust the stack
if flags & VM_CALL_OPT_SEND != 0 {
handle_opt_send_shift_stack(asm, argc, ctx);
}
// push_splat_args does stack manipulation so we can no longer side exit
if flags & VM_CALL_ARGS_SPLAT != 0 {
let required_args : u32 = (cfunc_argc as u32).saturating_sub(argc as u32 - 1);
@ -4771,6 +4766,11 @@ fn gen_send_cfunc(
push_splat_args(required_args, ctx, asm, ocb, side_exit)
}
// This is a .send call and we need to adjust the stack
if flags & VM_CALL_OPT_SEND != 0 {
handle_opt_send_shift_stack(asm, argc, ctx);
}
// Points to the receiver operand on the stack
let recv = ctx.stack_opnd(argc);
@ -5971,11 +5971,6 @@ fn gen_send_general(
return CantCompile;
}
if flags & VM_CALL_ARGS_SPLAT != 0 {
gen_counter_incr!(asm, send_args_splat_optimized);
return CantCompile;
}
let opt_type = unsafe { get_cme_def_body_optimized_type(cme) };
match opt_type {
OPTIMIZED_METHOD_TYPE_SEND => {
@ -6098,6 +6093,11 @@ fn gen_send_general(
return CantCompile;
}
if flags & VM_CALL_ARGS_SPLAT != 0 {
gen_counter_incr!(asm, send_args_splat_opt_call);
return CantCompile;
}
// Optimize for single ractor mode and avoid runtime check for
// "defined with an un-shareable Proc in a different Ractor"
if !assume_single_ractor_mode(jit, ocb) {

View File

@ -218,7 +218,7 @@ make_counters! {
send_args_splat_bmethod,
send_args_splat_aref,
send_args_splat_aset,
send_args_splat_optimized,
send_args_splat_opt_call,
send_args_splat_cfunc_var_args,
send_args_splat_cfunc_zuper,
send_args_splat_cfunc_ruby2_keywords,