@@ -975,14 +975,13 @@ def rb_path_to_class(path)
975975
976976 def rb_proc_new ( function , value )
977977 Proc . new do |*args , &block |
978- Primitive . cext_unwrap (
979- Primitive . call_with_c_mutex_and_frame ( function , [
980- Primitive . cext_wrap ( args . first ) , # yieldarg
981- Primitive . cext_wrap ( value ) , # procarg,
982- args . size , # argc
983- Truffle ::CExt . RARRAY_PTR ( args ) , # argv
984- Primitive . cext_wrap ( block ) , # blockarg
985- ] , Primitive . caller_special_variables_if_available , nil ) )
978+ Primitive . call_with_c_mutex_and_frame_and_unwrap ( function , [
979+ Primitive . cext_wrap ( args . first ) , # yieldarg
980+ Primitive . cext_wrap ( value ) , # procarg,
981+ args . size , # argc
982+ Truffle ::CExt . RARRAY_PTR ( args ) , # argv
983+ Primitive . cext_wrap ( block ) , # blockarg
984+ ] , Primitive . caller_special_variables_if_available , nil )
986985 end
987986 end
988987
@@ -1062,7 +1061,7 @@ def rb_ivar_lookup(object, name, default_value)
10621061 end
10631062
10641063 def rb_cvar_defined ( cls , id )
1065- id_s = id . to_s
1064+ id_s = id . name
10661065 if id_s . start_with? ( '@@' ) || !id_s . start_with? ( '@' )
10671066 cls . class_variable_defined? ( id )
10681067 else
@@ -1127,7 +1126,7 @@ def rb_special_const_p(object)
11271126 end
11281127
11291128 def rb_id2str ( sym )
1130- sym . to_s
1129+ sym . name
11311130 end
11321131
11331132 def rb_const_defined? ( mod , name )
@@ -1227,7 +1226,7 @@ def rb_enumeratorize(obj, meth, args)
12271226 def rb_enumeratorize_with_size ( obj , meth , args , size_fn )
12281227 return rb_enumeratorize ( obj , meth , args ) if size_fn . nil?
12291228 enum = obj . to_enum ( meth , *args ) do
1230- Primitive . cext_unwrap ( Primitive . call_with_c_mutex_and_frame ( size_fn , [ Primitive . cext_wrap ( obj ) , Primitive . cext_wrap ( args ) , Primitive . cext_wrap ( enum ) ] , Primitive . caller_special_variables_if_available , nil ) )
1229+ Primitive . call_with_c_mutex_and_frame_and_unwrap ( size_fn , [ Primitive . cext_wrap ( obj ) , Primitive . cext_wrap ( args ) , Primitive . cext_wrap ( enum ) ] , Primitive . caller_special_variables_if_available , nil )
12311230 end
12321231 enum
12331232 end
@@ -1242,7 +1241,7 @@ def rb_newobj_of(ruby_class)
12421241
12431242 def rb_define_alloc_func ( ruby_class , function )
12441243 ruby_class . singleton_class . define_method ( :__allocate__ ) do
1245- Primitive . cext_unwrap ( Primitive . call_with_c_mutex_and_frame ( function , [ Primitive . cext_wrap ( self ) ] , Primitive . caller_special_variables_if_available , nil ) )
1244+ Primitive . call_with_c_mutex_and_frame_and_unwrap ( function , [ Primitive . cext_wrap ( self ) ] , Primitive . caller_special_variables_if_available , nil )
12461245 end
12471246 class << ruby_class
12481247 private :__allocate__
@@ -1667,13 +1666,13 @@ def rb_thread_call_without_gvl(function, data1, unblock, data2)
16671666 def rb_iterate ( iteration , iterated_object , callback , callback_arg )
16681667 block = rb_block_proc
16691668 wrapped_callback = proc do |block_arg |
1670- Primitive . cext_unwrap ( Primitive . call_with_c_mutex_and_frame ( callback , [
1669+ Primitive . call_with_c_mutex_and_frame_and_unwrap ( callback , [
16711670 Primitive . cext_wrap ( block_arg ) ,
16721671 Primitive . cext_wrap ( callback_arg ) ,
16731672 0 , # argc
16741673 nil , # argv
16751674 nil , # blockarg
1676- ] , Primitive . cext_special_variables_from_stack , block ) )
1675+ ] , Primitive . cext_special_variables_from_stack , block )
16771676 end
16781677 Primitive . cext_unwrap (
16791678 Primitive . call_with_c_mutex_and_frame ( iteration , [ Primitive . cext_wrap ( iterated_object ) ] , Primitive . cext_special_variables_from_stack , wrapped_callback ) )
@@ -1761,7 +1760,7 @@ def rb_gv_set(name, value)
17611760 end
17621761
17631762 def rb_gv_get ( name )
1764- name = "$#{ name } " unless name . to_s . start_with? ( '$' )
1763+ name = "$#{ name } " unless name . start_with? ( '$' )
17651764 if name == '$~'
17661765 rb_backref_get
17671766 else
@@ -1785,7 +1784,7 @@ def rb_define_hooked_variable(name, gvar, getter, setter)
17851784 id = name . to_sym
17861785
17871786 getter_proc = -> {
1788- Primitive . cext_unwrap ( Primitive . call_with_c_mutex_and_frame ( getter , [ Primitive . cext_wrap ( id ) , gvar , Primitive . cext_wrap ( nil ) ] , Primitive . caller_special_variables_if_available , nil ) )
1787+ Primitive . call_with_c_mutex_and_frame_and_unwrap ( getter , [ Primitive . cext_wrap ( id ) , gvar , Primitive . cext_wrap ( nil ) ] , Primitive . caller_special_variables_if_available , nil )
17891788 }
17901789
17911790 setter_proc = -> value {
@@ -1910,14 +1909,13 @@ def rb_fiber_current
19101909
19111910 def rb_fiber_new ( function , value )
19121911 Fiber . new do |*args |
1913- Primitive . cext_unwrap (
1914- Primitive . call_with_c_mutex_and_frame ( function , [
1915- Primitive . cext_wrap ( args . first ) , # yieldarg
1916- nil , # procarg,
1917- 0 , # argc
1918- nil , # argv
1919- nil , # blockarg
1920- ] , nil , nil ) )
1912+ Primitive . call_with_c_mutex_and_frame_and_unwrap ( function , [
1913+ Primitive . cext_wrap ( args . first ) , # yieldarg
1914+ nil , # procarg,
1915+ 0 , # argc
1916+ nil , # argv
1917+ nil , # blockarg
1918+ ] , nil , nil )
19211919 end
19221920 end
19231921
0 commit comments