Remove an unneeded function copy
This commit is contained in:
parent
6c55c3eb7f
commit
1b475fcd10
11
array.c
11
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 */
|
||||
|
@ -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
|
||||
|
2
rjit_c.c
2
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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
3
yjit.c
3
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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user