summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2022-06-15 21:58:16 -0700
committerJohn Hawthorn <john@hawthorn.email>2022-06-21 18:33:51 -0700
commit0c1f64396fe351bb47e7ce46354da3eb98d41d40 (patch)
treed77c7293df050605273f33d379c0e6f1218c804a /yjit
parent9312f4bf62224cc0a11175cb6f9b7d0dd840a491 (diff)
Skip protected ancestry guard for FCALLs in YJIT
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5643
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs7
1 files changed, 6 insertions, 1 deletions
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!");