diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2022-12-02 11:40:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-02 11:40:16 -0500 |
commit | eb2b717a8bfc18f8ee53ff3d738bcfd3960f8fa4 (patch) | |
tree | 7301ebe968a82fab34974e668255eae1aff73d5e /yjit/bindgen | |
parent | fa77bcf7220a5515323a53a8320132418124f202 (diff) | |
download | ruby-eb2b717a8bfc18f8ee53ff3d738bcfd3960f8fa4.tar.gz |
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 <takashikkbn@gmail.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Diffstat (limited to 'yjit/bindgen')
-rw-r--r-- | yjit/bindgen/src/main.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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") |