ruby-changes:72441
From: Noah <ko1@a...>
Date: Thu, 7 Jul 2022 00:26:18 +0900 (JST)
Subject: [ruby-changes:72441] a2e0815e27 (master): Switch YJIT to using rb_str_buf_append rather than rb_str_append when encodings don't match, as discussed with byroot
https://git.ruby-lang.org/ruby.git/commit/?id=a2e0815e27 From a2e0815e27e7eb35d57a5bd4c09630797e1869fc Mon Sep 17 00:00:00 2001 From: "Noah Gibbs (and/or Benchmark CI)" <noah.gibbs@s...> Date: Wed, 6 Jul 2022 11:47:34 +0000 Subject: Switch YJIT to using rb_str_buf_append rather than rb_str_append when encodings don't match, as discussed with byroot --- yjit/bindgen/src/main.rs | 2 +- yjit/src/codegen.rs | 2 +- yjit/src/cruby_bindings.inc.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs index 5abd445dae..5d30d7b288 100644 --- a/yjit/bindgen/src/main.rs +++ b/yjit/bindgen/src/main.rs @@ -64,7 +64,7 @@ fn main() { https://github.com/ruby/ruby/blob/trunk/yjit/bindgen/src/main.rs#L64 // From include/ruby/internal/intern/string.h .allowlist_function("rb_utf8_str_new") - .allowlist_function("rb_str_append") + .allowlist_function("rb_str_buf_append") .allowlist_function("rb_str_dup") // This struct is public to Ruby C extensions diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 12c97411b0..84f4ff4897 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -3792,7 +3792,7 @@ fn jit_rb_str_concat( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3792 // If encodings are different, use a slower encoding-aware concatenate 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 cb.write_label(ret_label); diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs index 44f87a8482..88ad8e563c 100644 --- a/yjit/src/cruby_bindings.inc.rs +++ b/yjit/src/cruby_bindings.inc.rs @@ -224,10 +224,10 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/yjit/src/cruby_bindings.inc.rs#L224 ) -> VALUE; } extern "C" { - pub fn rb_str_dup(str_: VALUE) -> VALUE; + pub fn rb_str_buf_append(dst: VALUE, src: VALUE) -> VALUE; } extern "C" { - pub fn rb_str_append(dst: VALUE, src: VALUE) -> VALUE; + pub fn rb_str_dup(str_: VALUE) -> VALUE; } extern "C" { pub fn rb_str_intern(str_: VALUE) -> VALUE; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/