summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-09-07 11:22:34 -0700
committerGitHub <noreply@github.com>2023-09-07 14:22:34 -0400
commitfcdedf7f47b0ec495a0e3adca4c3f44b84afa98e (patch)
tree008f0b68be2804320b133c75da783030504b987e /yjit
parent60a52caf87c7e9ddfca73120c9d5b5030793ed77 (diff)
YJIT: Decrease SEND_MAX_DEPTH to 5 (#8390)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs31
1 files changed, 14 insertions, 17 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index a99594c3ab..a32657beeb 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -2035,10 +2035,10 @@ fn jit_chain_guard(
}
}
-// up to 5 different classes, and embedded or not for each
+// up to 10 different classes, and embedded or not for each
pub const GET_IVAR_MAX_DEPTH: i32 = 10;
-// up to 5 different classes, and embedded or not for each
+// up to 10 different classes, and embedded or not for each
pub const SET_IVAR_MAX_DEPTH: i32 = 10;
// hashes and arrays
@@ -2047,11 +2047,8 @@ pub const OPT_AREF_MAX_CHAIN_DEPTH: i32 = 2;
// expandarray
pub const EXPANDARRAY_MAX_CHAIN_DEPTH: i32 = 4;
-// up to 10 different classes
-pub const SEND_MAX_DEPTH: i32 = 20;
-
-// up to 20 different methods for send
-pub const SEND_MAX_CHAIN_DEPTH: i32 = 20;
+// up to 5 different methods for send
+pub const SEND_MAX_DEPTH: i32 = 5;
// up to 20 different offsets for case-when
pub const CASE_WHEN_MAX_DEPTH: i32 = 20;
@@ -4385,7 +4382,7 @@ fn jit_rb_kernel_instance_of(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_send_instance_of_class_mismatch,
);
@@ -4986,7 +4983,7 @@ fn jit_obj_respond_to(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_send_respond_to_mid_mismatch,
);
@@ -6038,7 +6035,7 @@ fn gen_send_iseq(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_send_block_arg_type,
);
@@ -7186,7 +7183,7 @@ fn gen_send_general(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_send_send_chain,
);
@@ -7428,7 +7425,7 @@ fn gen_invokeblock_specialized(
}
// Fallback to dynamic dispatch if this callsite is megamorphic
- if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_CHAIN_DEPTH {
+ if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_DEPTH {
gen_counter_incr(asm, Counter::invokeblock_megamorphic);
return None;
}
@@ -7462,7 +7459,7 @@ fn gen_invokeblock_specialized(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_invokeblock_tag_changed,
);
@@ -7478,7 +7475,7 @@ fn gen_invokeblock_specialized(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_invokeblock_iseq_block_changed,
);
@@ -7521,7 +7518,7 @@ fn gen_invokeblock_specialized(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_invokeblock_tag_changed,
);
@@ -7602,7 +7599,7 @@ fn gen_invokesuper_specialized(
};
// Fallback to dynamic dispatch if this callsite is megamorphic
- if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_CHAIN_DEPTH {
+ if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_DEPTH {
gen_counter_incr(asm, Counter::invokesuper_megamorphic);
return None;
}
@@ -7686,7 +7683,7 @@ fn gen_invokesuper_specialized(
jit,
asm,
ocb,
- SEND_MAX_CHAIN_DEPTH,
+ SEND_MAX_DEPTH,
Counter::guard_invokesuper_me_changed,
);