Skip to content

Commit 6d79de8

Browse files
committed
Implement rb_check_funcall()
1 parent 9f6bc43 commit 6d79de8

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Compatibility:
3030
* Support `Socket.sockaddr_in(port, Socket::INADDR_ANY)` (#3361, @mtortonesi).
3131
* Implement the `Data` class from Ruby 3.2 (#3039, @moste00, @eregon).
3232
* Make `Coverage.start` and `Coverage.result` accept parameters (#3149, @mtortonesi, @andrykonchin).
33+
* Implement `rb_check_funcall()` (@eregon).
3334

3435
Performance:
3536

lib/cext/include/truffleruby/truffleruby-abi-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
// $RUBY_VERSION must be the same as TruffleRuby.LANGUAGE_VERSION.
1111
// $ABI_NUMBER starts at 1 and is incremented for every ABI-incompatible change.
1212

13-
#define TRUFFLERUBY_ABI_VERSION "3.2.2.9"
13+
#define TRUFFLERUBY_ABI_VERSION "3.2.2.10"
1414

1515
#endif

lib/truffle/truffle/cext.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,10 @@ def rb_funcallv(recv, meth, argv)
10601060
Primitive.send_argv_without_cext_lock(recv, meth, argv, nil)
10611061
end
10621062

1063+
def rb_check_funcall(recv, meth, args)
1064+
Primitive.send_without_cext_lock(Truffle::Type, :check_funcall, [recv, meth, args], nil)
1065+
end
1066+
10631067
def rb_funcallv_keywords(recv, meth, argv)
10641068
Primitive.send_argv_keywords_without_cext_lock(recv, meth, argv, nil)
10651069
end

src/main/c/cext/call.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ VALUE rb_funcallv_public(VALUE object, ID name, int args_count, const VALUE *arg
4949
polyglot_from_VALUE_array(args, args_count)));
5050
}
5151

52+
VALUE rb_check_funcall(VALUE object, ID name, int args_count, const VALUE *args) {
53+
return rb_tr_wrap(polyglot_invoke(RUBY_CEXT, "rb_check_funcall",
54+
rb_tr_unwrap(object),
55+
rb_tr_unwrap(ID2SYM(name)),
56+
rb_tr_unwrap(rb_ary_new_from_values(args_count, args))));
57+
}
58+
5259
VALUE rb_apply(VALUE object, ID name, VALUE args) {
5360
return RUBY_CEXT_INVOKE("rb_apply", object, ID2SYM(name), args);
5461
}

0 commit comments

Comments
 (0)