1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Switch YJIT to using rb_str_buf_append rather than rb_str_append when encodings don't match, as discussed with byroot

This commit is contained in:
Noah Gibbs (and/or Benchmark CI) 2022-07-06 11:47:34 +00:00 committed by Jean Boussier
parent 906f7cb3e7
commit a2e0815e27
Notes: git 2022-07-07 00:26:24 +09:00
3 changed files with 4 additions and 4 deletions

View file

@ -64,7 +64,7 @@ fn main() {
// From include/ruby/internal/intern/string.h // From include/ruby/internal/intern/string.h
.allowlist_function("rb_utf8_str_new") .allowlist_function("rb_utf8_str_new")
.allowlist_function("rb_str_append") .allowlist_function("rb_str_buf_append")
.allowlist_function("rb_str_dup") .allowlist_function("rb_str_dup")
// This struct is public to Ruby C extensions // This struct is public to Ruby C extensions

View file

@ -3792,7 +3792,7 @@ fn jit_rb_str_concat(
// If encodings are different, use a slower encoding-aware concatenate // If encodings are different, use a slower encoding-aware concatenate
cb.write_label(enc_mismatch); cb.write_label(enc_mismatch);
call_ptr(cb, REG0, rb_str_append as *const u8); call_ptr(cb, REG0, rb_str_buf_append as *const u8);
// Drop through to return // Drop through to return
cb.write_label(ret_label); cb.write_label(ret_label);

View file

@ -224,10 +224,10 @@ extern "C" {
) -> VALUE; ) -> VALUE;
} }
extern "C" { extern "C" {
pub fn rb_str_dup(str_: VALUE) -> VALUE; pub fn rb_str_buf_append(dst: VALUE, src: VALUE) -> VALUE;
} }
extern "C" { extern "C" {
pub fn rb_str_append(dst: VALUE, src: VALUE) -> VALUE; pub fn rb_str_dup(str_: VALUE) -> VALUE;
} }
extern "C" { extern "C" {
pub fn rb_str_intern(str_: VALUE) -> VALUE; pub fn rb_str_intern(str_: VALUE) -> VALUE;