summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-02-09 07:16:17 -0800
committerGitHub <noreply@github.com>2023-02-09 10:16:17 -0500
commite2b6289bab16ff2e05e8ac7a8bc3a35bcc2c44ed (patch)
tree090b505ba43cfb7ce277c69d590df68463e434a2 /yjit
parentda4464b824857d7610f9865ceb452ce0ead49164 (diff)
YJIT: Add counters for ivar exits (#7266)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs8
-rw-r--r--yjit/src/stats.rs2
2 files changed, 9 insertions, 1 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 2679380762..1093e3b74b 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -1977,6 +1977,7 @@ fn gen_get_ivar(
) -> CodegenStatus {
// If the object has a too complex shape, we exit
if comptime_receiver.shape_too_complex() {
+ gen_counter_incr!(asm, getivar_too_complex);
return CantCompile;
}
@@ -2209,8 +2210,13 @@ fn gen_setinstancevariable(
// If the comptime receiver is frozen, writing an IV will raise an exception
// and we don't want to JIT code to deal with that situation.
+ if comptime_receiver.is_frozen() {
+ gen_counter_incr!(asm, setivar_frozen);
+ return CantCompile;
+ }
// If the object has a too complex shape, we will also exit
- if comptime_receiver.is_frozen() || comptime_receiver.shape_too_complex() {
+ if comptime_receiver.shape_too_complex() {
+ gen_counter_incr!(asm, setivar_too_complex);
return CantCompile;
}
diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs
index 0453a2a733..e9408b71c7 100644
--- a/yjit/src/stats.rs
+++ b/yjit/src/stats.rs
@@ -264,6 +264,7 @@ make_counters! {
getivar_se_self_not_heap,
getivar_idx_out_of_range,
getivar_megamorphic,
+ getivar_too_complex,
setivar_se_self_not_heap,
setivar_idx_out_of_range,
@@ -272,6 +273,7 @@ make_counters! {
setivar_not_object,
setivar_frozen,
setivar_megamorphic,
+ setivar_too_complex,
oaref_argc_not_one,
oaref_arg_not_fixnum,