From eb2b717a8bfc18f8ee53ff3d738bcfd3960f8fa4 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Fri, 2 Dec 2022 11:40:16 -0500 Subject: YJIT: Make case-when optimization respect === redefinition (#6846) * YJIT: Make case-when optimization respect === redefinition Even when a fixnum key is in the dispatch hash, if there is a case such that its basic operations for === is redefined, we need to fall back to checking each case like the interpreter. Semantically we're always checking each case by calling === in order, it's just that this is not observable when basic operations are intact. When all the keys are fixnums, though, we can do the optimization we're doing right now. Check for this condition. * Update yjit/src/cruby_bindings.inc.rs Co-authored-by: Takashi Kokubun Co-authored-by: Takashi Kokubun --- yjit/bindgen/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'yjit/bindgen') diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs index ffcc148685..8098de87b0 100644 --- a/yjit/bindgen/src/main.rs +++ b/yjit/bindgen/src/main.rs @@ -100,6 +100,10 @@ fn main() { // From internal/hash.h .allowlist_function("rb_hash_new_with_size") .allowlist_function("rb_hash_resurrect") + .allowlist_function("rb_hash_stlike_foreach") + + // From include/ruby/st.h + .allowlist_type("st_retval") // From include/ruby/internal/intern/hash.h .allowlist_function("rb_hash_aset") -- cgit v1.2.1