From 0c1f64396fe351bb47e7ce46354da3eb98d41d40 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Wed, 15 Jun 2022 21:58:16 -0700 Subject: Skip protected ancestry guard for FCALLs in YJIT --- yjit/src/codegen.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'yjit') diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 75249658fb..ef94d58397 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -4825,7 +4825,12 @@ fn gen_send_general( } } METHOD_VISI_PROTECTED => { - jit_protected_callee_ancestry_guard(jit, cb, ocb, cme, side_exit); + // If the method call is an FCALL, it is always valid + if flags & VM_CALL_FCALL == 0 { + // otherwise we need an ancestry check to ensure the receiver is vaild to be called + // as protected + jit_protected_callee_ancestry_guard(jit, cb, ocb, cme, side_exit); + } } _ => { panic!("cmes should always have a visibility!"); -- cgit v1.2.3