diff options
author | Noah Gibbs <noah.gibbs@shopify.com> | 2022-05-11 16:20:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-11 11:20:21 -0400 |
commit | e88ada469976e1dad653748bd2c0bedca9e30981 (patch) | |
tree | aab2347018b139a0f48fc99390f43df7f72e61e5 /yjit/src/cruby_bindings.inc.rs | |
parent | c00feffb46ac646605adc277b5454e6b067e2d8a (diff) |
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.
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit/src/cruby_bindings.inc.rs')
-rw-r--r-- | yjit/src/cruby_bindings.inc.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs index 2be42f5c63..ac54ba4446 100644 --- a/yjit/src/cruby_bindings.inc.rs +++ b/yjit/src/cruby_bindings.inc.rs @@ -173,6 +173,9 @@ extern "C" { ) -> VALUE; } extern "C" { + pub fn rb_str_append(dst: VALUE, src: VALUE) -> VALUE; +} +extern "C" { pub fn rb_str_intern(str_: VALUE) -> VALUE; } extern "C" { @@ -181,6 +184,11 @@ extern "C" { extern "C" { pub fn rb_attr_get(obj: VALUE, name: ID) -> VALUE; } +pub const RUBY_ENCODING_INLINE_MAX: ruby_encoding_consts = 127; +pub const RUBY_ENCODING_SHIFT: ruby_encoding_consts = 22; +pub const RUBY_ENCODING_MASK: ruby_encoding_consts = 532676608; +pub const RUBY_ENCODING_MAXNAMELEN: ruby_encoding_consts = 42; +pub type ruby_encoding_consts = u32; extern "C" { pub fn rb_obj_info_dump(obj: VALUE); } @@ -732,6 +740,9 @@ extern "C" { pub fn rb_leaf_builtin_function(iseq: *const rb_iseq_t) -> *const rb_builtin_function; } extern "C" { + pub fn rb_yjit_str_simple_append(str1: VALUE, str2: VALUE) -> VALUE; +} +extern "C" { pub fn rb_set_cfp_pc(cfp: *mut rb_control_frame_struct, pc: *const VALUE); } extern "C" { @@ -744,6 +755,9 @@ extern "C" { pub fn rb_yjit_dump_iseq_loc(iseq: *const rb_iseq_t, insn_idx: u32); } extern "C" { + pub fn rb_ENCODING_GET(obj: VALUE) -> ::std::os::raw::c_int; +} +extern "C" { pub fn rb_yjit_multi_ractor_p() -> bool; } extern "C" { |