From e88ada469976e1dad653748bd2c0bedca9e30981 Mon Sep 17 00:00:00 2001 From: Noah Gibbs Date: Wed, 11 May 2022 16:20:21 +0100 Subject: Ruby shovel operator (<<) speedup. (#5896) For string concat, see if compile-time encoding of strings matches. If so, use simple buffer string concat at runtime. Otherwise, use encoding-checking string concat. --- yjit/bindgen/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'yjit/bindgen/src') diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs index 0264751a6f..33f81366c2 100644 --- a/yjit/bindgen/src/main.rs +++ b/yjit/bindgen/src/main.rs @@ -33,6 +33,7 @@ fn main() { let bindings = bindgen::builder() .clang_args(filtered_clang_args) + .header("encindex.h") .header("internal.h") .header("internal/re.h") .header("include/ruby/ruby.h") @@ -57,6 +58,7 @@ fn main() { // From include/ruby/internal/intern/string.h .allowlist_function("rb_utf8_str_new") + .allowlist_function("rb_str_append") // This struct is public to Ruby C extensions // From include/ruby/internal/core/rbasic.h @@ -69,6 +71,9 @@ fn main() { // From ruby/internal/intern/object.h .allowlist_function("rb_obj_is_kind_of") + // From ruby/internal/encoding/encoding.h + .allowlist_type("ruby_encoding_consts") + // From include/hash.h .allowlist_function("rb_hash_new") @@ -228,6 +233,8 @@ fn main() { .allowlist_function("rb_yjit_dump_iseq_loc") .allowlist_function("rb_yjit_for_each_iseq") .allowlist_function("rb_yjit_obj_written") + .allowlist_function("rb_yjit_str_simple_append") + .allowlist_function("rb_ENCODING_GET") // from vm_sync.h .allowlist_function("rb_vm_barrier") -- cgit v1.2.3