summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--array.c11
-rw-r--r--lib/ruby_vm/rjit/insn_compiler.rb2
-rw-r--r--rjit_c.c2
-rw-r--r--rjit_c.rb8
-rwxr-xr-xtool/rjit/bindgen.rb2
-rw-r--r--yjit.c3
-rw-r--r--yjit/bindgen/src/main.rs2
-rw-r--r--yjit/src/codegen.rs2
-rw-r--r--yjit/src/cruby_bindings.inc.rs6
9 files changed, 13 insertions, 25 deletions
diff --git a/array.c b/array.c
index 64bc744aac..d9ec1e434a 100644
--- a/array.c
+++ b/array.c
@@ -1787,7 +1787,7 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
* Related: #push, #pop, #shift.
*/
-static VALUE
+VALUE
rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
long len = RARRAY_LEN(ary);
@@ -1804,17 +1804,10 @@ rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
return ary;
}
-/* non-static for yjit */
-VALUE
-rb_yjit_rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
-{
- return rb_ary_unshift_m(argc, argv, ary);
-}
-
VALUE
rb_ary_unshift(VALUE ary, VALUE item)
{
- return rb_ary_unshift_m(1,&item,ary);
+ return rb_ary_unshift_m(1, &item, ary);
}
/* faster version - use this if you don't need to treat negative offset */
diff --git a/lib/ruby_vm/rjit/insn_compiler.rb b/lib/ruby_vm/rjit/insn_compiler.rb
index b328ba3765..22055fc11e 100644
--- a/lib/ruby_vm/rjit/insn_compiler.rb
+++ b/lib/ruby_vm/rjit/insn_compiler.rb
@@ -4315,7 +4315,7 @@ module RubyVM::RJIT
asm.mov(C_ARGS[0], diff)
asm.mov(C_ARGS[1], values_ptr)
asm.mov(C_ARGS[2], array)
- asm.call(C.rb_yjit_rb_ary_unshift_m)
+ asm.call(C.rb_ary_unshift_m)
ctx.stack_pop(diff)
stack_ret = ctx.stack_push
diff --git a/rjit_c.c b/rjit_c.c
index 1ef5254f9f..9e442f5f6f 100644
--- a/rjit_c.c
+++ b/rjit_c.c
@@ -514,7 +514,7 @@ extern VALUE rb_str_bytesize(VALUE str);
extern const rb_callable_method_entry_t *rb_callable_method_entry_or_negative(VALUE klass, ID mid);
extern VALUE rb_vm_yield_with_cfunc(rb_execution_context_t *ec, const struct rb_captured_block *captured, int argc, const VALUE *argv);
extern VALUE rb_vm_set_ivar_id(VALUE obj, ID id, VALUE val);
-extern VALUE rb_yjit_rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary);
+extern VALUE rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary);
#include "rjit_c.rbinc"
diff --git a/rjit_c.rb b/rjit_c.rb
index 9587884404..52565fc9b6 100644
--- a/rjit_c.rb
+++ b/rjit_c.rb
@@ -543,6 +543,10 @@ module RubyVM::RJIT # :nodoc: all
Primitive.cexpr! %q{ SIZET2NUM((size_t)rb_ary_tmp_new_from_values) }
end
+ def C.rb_ary_unshift_m
+ Primitive.cexpr! %q{ SIZET2NUM((size_t)rb_ary_unshift_m) }
+ end
+
def C.rb_backref_get
Primitive.cexpr! %q{ SIZET2NUM((size_t)rb_backref_get) }
end
@@ -731,10 +735,6 @@ module RubyVM::RJIT # :nodoc: all
Primitive.cexpr! %q{ SIZET2NUM((size_t)rb_vm_yield_with_cfunc) }
end
- def C.rb_yjit_rb_ary_unshift_m
- Primitive.cexpr! %q{ SIZET2NUM((size_t)rb_yjit_rb_ary_unshift_m) }
- end
-
def C.rjit_full_cfunc_return
Primitive.cexpr! %q{ SIZET2NUM((size_t)rjit_full_cfunc_return) }
end
diff --git a/tool/rjit/bindgen.rb b/tool/rjit/bindgen.rb
index 88ac3a6161..98d1ee775a 100755
--- a/tool/rjit/bindgen.rb
+++ b/tool/rjit/bindgen.rb
@@ -565,7 +565,7 @@ generator = BindingGenerator.new(
rb_vm_set_ivar_id
rb_ary_dup
rjit_rb_ary_subseq_length
- rb_yjit_rb_ary_unshift_m
+ rb_ary_unshift_m
],
types: %w[
CALL_DATA
diff --git a/yjit.c b/yjit.c
index 3740b9003d..9f8c557489 100644
--- a/yjit.c
+++ b/yjit.c
@@ -845,8 +845,7 @@ rb_yarv_ary_entry_internal(VALUE ary, long offset)
return rb_ary_entry_internal(ary, offset);
}
-VALUE
-rb_yjit_rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary);
+extern VALUE rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary);
VALUE
rb_yjit_rb_ary_subseq_length(VALUE ary, long beg)
diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs
index a2af76a787..627a88fd31 100644
--- a/yjit/bindgen/src/main.rs
+++ b/yjit/bindgen/src/main.rs
@@ -136,7 +136,7 @@ fn main() {
.allowlist_function("rb_ary_resurrect")
.allowlist_function("rb_ary_clear")
.allowlist_function("rb_ary_dup")
- .allowlist_function("rb_yjit_rb_ary_unshift_m")
+ .allowlist_function("rb_ary_unshift_m")
.allowlist_function("rb_yjit_rb_ary_subseq_length")
// From internal/array.h
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index b18c855b7a..750ac9e5f5 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -5821,7 +5821,7 @@ fn gen_send_iseq(
asm.comment("prepend stack values to rest array");
let array = asm.ccall(
- rb_yjit_rb_ary_unshift_m as *const u8,
+ rb_ary_unshift_m as *const u8,
vec![Opnd::UImm(diff as u64), values_ptr, array],
);
ctx.stack_pop(diff as usize);
diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs
index 83077f8f1b..3e05388308 100644
--- a/yjit/src/cruby_bindings.inc.rs
+++ b/yjit/src/cruby_bindings.inc.rs
@@ -1296,11 +1296,7 @@ extern "C" {
pub fn rb_yarv_str_eql_internal(str1: VALUE, str2: VALUE) -> VALUE;
pub fn rb_str_neq_internal(str1: VALUE, str2: VALUE) -> VALUE;
pub fn rb_yarv_ary_entry_internal(ary: VALUE, offset: ::std::os::raw::c_long) -> VALUE;
- pub fn rb_yjit_rb_ary_unshift_m(
- argc: ::std::os::raw::c_int,
- argv: *mut VALUE,
- ary: VALUE,
- ) -> VALUE;
+ pub fn rb_ary_unshift_m(argc: ::std::os::raw::c_int, argv: *mut VALUE, ary: VALUE) -> VALUE;
pub fn rb_yjit_rb_ary_subseq_length(ary: VALUE, beg: ::std::os::raw::c_long) -> VALUE;
pub fn rb_yarv_fix_mod_fix(recv: VALUE, obj: VALUE) -> VALUE;
pub fn rb_yjit_dump_iseq_loc(iseq: *const rb_iseq_t, insn_idx: u32);