@@ -19,22 +19,22 @@ def rb_define_method(mod, name, function, argc)
19
19
20
20
method_body = Truffle ::Graal . copy_captured_locals -> *args , &block do
21
21
if argc == -1 # (int argc, VALUE *argv, VALUE obj)
22
- args = [ args . size , Truffle ::CExt . RARRAY_PTR ( args ) , Truffle . invoke_primitive ( :cext_wrap , self ) ]
22
+ args = [ args . size , Truffle ::CExt . RARRAY_PTR ( args ) , Truffle . invoke_primitive ( :cext_wrap , self ) ]
23
23
elsif argc == -2 # (VALUE obj, VALUE rubyArrayArgs)
24
- args = [ Truffle . invoke_primitive ( :cext_wrap , self ) , Truffle . invoke_primitive ( :cext_wrap , args ) ]
24
+ args = [ Truffle . invoke_primitive ( :cext_wrap , self ) , Truffle . invoke_primitive ( :cext_wrap , args ) ]
25
25
elsif argc >= 0 # (VALUE obj); (VALUE obj, VALUE arg1); (VALUE obj, VALUE arg1, VALUE arg2); ...
26
26
if args . size != argc
27
27
raise ArgumentError , "wrong number of arguments (given #{ args . size } , expected #{ argc } )"
28
28
end
29
- args = [ Truffle . invoke_primitive ( :cext_wrap , self ) , *args . map! { |arg | Truffle . invoke_primitive ( :cext_wrap , arg ) } ]
29
+ args = [ Truffle . invoke_primitive ( :cext_wrap , self ) , *args . map! { |arg | Truffle . invoke_primitive ( :cext_wrap , arg ) } ]
30
30
end
31
31
32
32
# Using raw execute instead of #call here to avoid argument conversion
33
33
34
34
# We must set block argument if given here so that the
35
35
# `rb_block_*` functions will be able to find it by walking the
36
36
# stack.
37
- Truffle . invoke_primitive ( :cext_unwrap , Truffle . invoke_primitive ( :call_with_c_mutex_and_frame , function , args , block ) )
37
+ Truffle . invoke_primitive ( :cext_unwrap , Truffle . invoke_primitive ( :call_with_c_mutex_and_frame , function , args , block ) )
38
38
end
39
39
40
40
mod . define_method ( name , method_body )
@@ -54,7 +54,7 @@ def call_with_thread_locally_stored_block(function, *args, &block)
54
54
previous_block = Thread . current [ :__C_BLOCK__ ]
55
55
begin
56
56
Thread . current [ :__C_BLOCK__ ] = block
57
- rb_tr_unwrap ( Truffle . invoke_primitive ( :call_with_c_mutex_and_frame , function , args . map! { |arg | Truffle . invoke_primitive ( :cext_wrap , arg ) } , block ) )
57
+ rb_tr_unwrap ( Truffle . invoke_primitive ( :call_with_c_mutex_and_frame , function , args . map! { |arg | Truffle . invoke_primitive ( :cext_wrap , arg ) } , block ) )
58
58
ensure
59
59
Thread . current [ :__C_BLOCK__ ] = previous_block
60
60
end
0 commit comments