summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-12-09 16:45:38 -0800
committerGitHub <noreply@github.com>2022-12-09 16:45:38 -0800
commit24043031be75cb5119cc4a6c1ffb2c867b567633 (patch)
tree0805d506cb5579de8a7b7bb410f297c536461714 /yjit
parent381e128c135e491689714cb69353d11e782f5994 (diff)
YJIT: Split send_iseq_complex_callee exit reasons (#6895)
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs32
-rw-r--r--yjit/src/stats.rs11
2 files changed, 28 insertions, 15 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 6a4026e947..e18594413c 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -4877,12 +4877,16 @@ fn gen_send_iseq(
// No support for callees with these parameters yet as they require allocation
// or complex handling.
- if unsafe {
- get_iseq_flags_has_rest(iseq)
- || get_iseq_flags_has_post(iseq)
- || get_iseq_flags_has_kwrest(iseq)
- } {
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ if unsafe { get_iseq_flags_has_rest(iseq) } {
+ gen_counter_incr!(asm, send_iseq_has_rest);
+ return CantCompile;
+ }
+ if unsafe { get_iseq_flags_has_post(iseq) } {
+ gen_counter_incr!(asm, send_iseq_has_post);
+ return CantCompile;
+ }
+ if unsafe { get_iseq_flags_has_kwrest(iseq) } {
+ gen_counter_incr!(asm, send_iseq_has_kwrest);
return CantCompile;
}
@@ -4902,14 +4906,14 @@ fn gen_send_iseq(
// positionals, then we need to allocate a hash. For now we're going to
// call that too complex and bail.
if supplying_kws && !unsafe { get_iseq_flags_has_kw(iseq) } {
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_has_no_kw);
return CantCompile;
}
// If we have a method accepting no kwargs (**nil), exit if we have passed
// it any kwargs.
if supplying_kws && unsafe { get_iseq_flags_accepts_no_kwarg(iseq) } {
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_accepts_no_kwarg);
return CantCompile;
}
@@ -4924,7 +4928,7 @@ fn gen_send_iseq(
// In this case (param.flags.has_block && local_iseq != iseq),
// the block argument is setup as a local variable and requires
// materialization (allocation). Bail.
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_materialized_block);
return CantCompile;
}
}
@@ -4958,12 +4962,12 @@ fn gen_send_iseq(
if opt_num > 0 && flags & VM_CALL_ARGS_SPLAT != 0 {
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_splat_with_opt);
return CantCompile;
}
if doing_kw_call && flags & VM_CALL_ARGS_SPLAT != 0 {
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_splat_with_kw);
return CantCompile;
}
@@ -5000,10 +5004,10 @@ fn gen_send_iseq(
}
// If we have unfilled optional arguments and keyword arguments then we
- // would need to move adjust the arguments location to account for that.
+ // would need to adjust the arguments location to account for that.
// For now we aren't handling this case.
if doing_kw_call && opts_missing > 0 {
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_missing_optional_kw);
return CantCompile;
}
@@ -5031,7 +5035,7 @@ fn gen_send_iseq(
// We have so many keywords that (1 << num) encoded as a FIXNUM
// (which shifts it left one more) no longer fits inside a 32-bit
// immediate.
- gen_counter_incr!(asm, send_iseq_complex_callee);
+ gen_counter_incr!(asm, send_iseq_too_many_kwargs);
return CantCompile;
}
diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs
index ee841a4c04..91e4ec078f 100644
--- a/yjit/src/stats.rs
+++ b/yjit/src/stats.rs
@@ -194,7 +194,16 @@ make_counters! {
send_iseq_only_keywords,
send_iseq_kwargs_req_and_opt_missing,
send_iseq_kwargs_mismatch,
- send_iseq_complex_callee,
+ send_iseq_has_rest,
+ send_iseq_has_post,
+ send_iseq_has_kwrest,
+ send_iseq_has_no_kw,
+ send_iseq_accepts_no_kwarg,
+ send_iseq_materialized_block,
+ send_iseq_splat_with_opt,
+ send_iseq_splat_with_kw,
+ send_iseq_missing_optional_kw,
+ send_iseq_too_many_kwargs,
send_not_implemented_method,
send_getter_arity,
send_se_cf_overflow,