@@ -441,7 +441,7 @@ fn gen_exit(exit_pc: *mut VALUE, ctx: &Context, cb: &mut CodeBlock) -> CodePtr
441
441
#[ cfg( feature = "stats" ) ]
442
442
if get_option ! ( gen_stats) {
443
443
mov ( cb, RDI , const_ptr_opnd ( exit_pc) ) ;
444
- call_ptr ( cb, RSI , CodePtr ( yjit_count_side_exit_op) ) ;
444
+ call_ptr ( cb, RSI , yjit_count_side_exit_op as * const u8 ) ;
445
445
}
446
446
447
447
pop ( cb, REG_SP ) ;
@@ -1424,8 +1424,7 @@ fn gen_newarray(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
1424
1424
mov ( cb, C_ARG_REGS [ 0 ] , REG_EC ) ;
1425
1425
mov ( cb, C_ARG_REGS [ 1 ] , imm_opnd ( n. into ( ) ) ) ;
1426
1426
lea ( cb, C_ARG_REGS [ 2 ] , values_ptr) ;
1427
- let ary_new = CodePtr :: from ( rb_ec_ary_new_from_values as * mut u8 ) ;
1428
- call_ptr ( cb, REG0 , ary_new) ;
1427
+ call_ptr ( cb, REG0 , rb_ec_ary_new_from_values as * const u8 ) ;
1429
1428
1430
1429
ctx. stack_pop ( n as usize ) ;
1431
1430
let stack_ret = ctx. stack_push ( Type :: Array ) ;
@@ -1444,8 +1443,7 @@ fn gen_duparray(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
1444
1443
1445
1444
// call rb_ary_resurrect(VALUE ary);
1446
1445
jit_mov_gc_ptr ( jit, cb, C_ARG_REGS [ 0 ] , ary) ;
1447
- let ary_res = CodePtr :: from ( rb_ary_resurrect as * mut u8 ) ;
1448
- call_ptr ( cb, REG0 , ary_res) ;
1446
+ call_ptr ( cb, REG0 , rb_ary_resurrect as * const u8 ) ;
1449
1447
1450
1448
let stack_ret = ctx. stack_push ( Type :: Array ) ;
1451
1449
mov ( cb, stack_ret, RAX ) ;
@@ -1463,8 +1461,7 @@ fn gen_duphash(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
1463
1461
1464
1462
// call rb_hash_resurrect(VALUE hash);
1465
1463
jit_mov_gc_ptr ( jit, cb, C_ARG_REGS [ 0 ] , hash) ;
1466
- let hash_res = CodePtr :: from ( rb_hash_resurrect as * mut u8 ) ;
1467
- call_ptr ( cb, REG0 , hash_res) ;
1464
+ call_ptr ( cb, REG0 , rb_hash_resurrect as * const u8 ) ;
1468
1465
1469
1466
let stack_ret = ctx. stack_push ( Type :: Hash ) ;
1470
1467
mov ( cb, stack_ret, RAX ) ;
@@ -1487,8 +1484,7 @@ fn gen_splatarray(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb
1487
1484
// Call rb_vm_splat_array(flag, ary)
1488
1485
jit_mov_gc_ptr ( jit, cb, C_ARG_REGS [ 0 ] , flag) ;
1489
1486
mov ( cb, C_ARG_REGS [ 1 ] , ary_opnd) ;
1490
- let splat_array = CodePtr :: from ( rb_vm_splat_array as * mut u8 ) ;
1491
- call_ptr ( cb, REG1 , splat_array) ;
1487
+ call_ptr ( cb, REG1 , rb_vm_splat_array as * const u8 ) ;
1492
1488
1493
1489
let stack_ret = ctx. stack_push ( Type :: Array ) ;
1494
1490
mov ( cb, stack_ret, RAX ) ;
@@ -1508,8 +1504,7 @@ fn gen_newrange(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
1508
1504
mov ( cb, C_ARG_REGS [ 0 ] , ctx. stack_opnd ( 1 ) ) ;
1509
1505
mov ( cb, C_ARG_REGS [ 1 ] , ctx. stack_opnd ( 0 ) ) ;
1510
1506
mov ( cb, C_ARG_REGS [ 2 ] , uimm_opnd ( flag. into ( ) ) ) ;
1511
- let range_new = CodePtr :: from ( rb_range_new as * mut u8 ) ;
1512
- call_ptr ( cb, REG0 , range_new) ;
1507
+ call_ptr ( cb, REG0 , rb_range_new as * const u8 ) ;
1513
1508
1514
1509
ctx. stack_pop ( 2 ) ;
1515
1510
let stack_ret = ctx. stack_push ( Type :: UnknownHeap ) ;
@@ -1807,8 +1802,7 @@ fn gen_newhash(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
1807
1802
if num != 0 {
1808
1803
// val = rb_hash_new_with_size(num / 2);
1809
1804
mov ( cb, C_ARG_REGS [ 0 ] , imm_opnd ( num / 2 ) ) ;
1810
- let hn_code_ptr = CodePtr :: from ( rb_hash_new_with_size as * mut u8 ) ;
1811
- call_ptr ( cb, REG0 , hn_code_ptr) ;
1805
+ call_ptr ( cb, REG0 , rb_hash_new_with_size as * const u8 ) ;
1812
1806
1813
1807
// save the allocated hash as we want to push it after insertion
1814
1808
push ( cb, RAX ) ;
@@ -1818,8 +1812,7 @@ fn gen_newhash(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
1818
1812
mov ( cb, C_ARG_REGS [ 0 ] , imm_opnd ( num) ) ;
1819
1813
lea ( cb, C_ARG_REGS [ 1 ] , ctx. stack_opnd ( ( num - 1 ) . try_into ( ) . unwrap ( ) ) ) ;
1820
1814
mov ( cb, C_ARG_REGS [ 2 ] , RAX ) ;
1821
- let bi_code_opnd = CodePtr :: from ( rb_hash_bulk_insert as * mut u8 ) ;
1822
- call_ptr ( cb, REG0 , bi_code_opnd) ;
1815
+ call_ptr ( cb, REG0 , rb_hash_bulk_insert as * const u8 ) ;
1823
1816
1824
1817
pop ( cb, RAX ) ; // alignment
1825
1818
pop ( cb, RAX ) ;
@@ -1830,8 +1823,7 @@ fn gen_newhash(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
1830
1823
}
1831
1824
else {
1832
1825
// val = rb_hash_new();
10000
1833
- let hn_code_ptr = CodePtr :: from ( rb_hash_new as * mut u8 ) ;
1834
- call_ptr ( cb, REG0 , hn_code_ptr) ;
1826
+ call_ptr ( cb, REG0 , rb_hash_new as * const u8 ) ;
1835
1827
1836
1828
let stack_ret = ctx. stack_push ( Type :: Hash ) ;
1837
1829
mov ( cb, stack_ret, RAX ) ;
@@ -1849,8 +1841,7 @@ fn gen_putstring(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
1849
1841
1850
1842
mov ( cb, C_ARG_REGS [ 0 ] , REG_EC ) ;
1851
1843
jit_mov_gc_ptr ( jit, cb, C_ARG_REGS [ 1 ] , put_val) ;
1852
- let str_resurrect = CodePtr :: from ( rb_ec_str_resurrect as * mut u8 ) ;
1853
- call_ptr ( cb, REG0 , str_resurrect) ;
1844
+ call_ptr ( cb, REG0 , rb_ec_str_resurrect as * const u8 ) ;
1854
1845
1855
1846
let stack_top = ctx. stack_push ( Type :: String ) ;
1856
1847
mov ( cb, stack_top, RAX ) ;
@@ -1980,8 +1971,7 @@ fn gen_set_ivar(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, recv:
1980
1971
mov ( cb, C_ARG_REGS [ 0 ] , recv_opnd) ;
1981
1972
mov ( cb, C_ARG_REGS [ 1 ] , imm_opnd ( ivar_index. into ( ) ) ) ;
1982
1973
mov ( cb, C_ARG_REGS [ 2 ] , val_opnd) ;
1983
- let set_ivar_idx = CodePtr :: from ( rb_vm_set_ivar_idx as * mut u8 ) ;
1984
- call_ptr ( cb, REG0 , set_ivar_idx) ;
1974
+ call_ptr ( cb, REG0 , rb_vm_set_ivar_idx as * const u8 ) ;
1985
1975
1986
1976
let out_opnd = ctx. stack_push ( Type :: Unknown ) ;
1987
1977
mov ( cb, out_opnd, RAX ) ;
@@ -1999,8 +1989,8 @@ fn gen_get_ivar(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
1999
1989
let comptime_val_klass = comptime_receiver. class_of ( ) ;
2000
1990
let starting_context = ctx. clone ( ) ; // make a copy for use with jit_chain_guard
2001
1991
2002
- let custom_allocator = unsafe { rb_get_alloc_func ( comptime_val_klass) . unwrap ( ) as * mut u8 } ;
2003
- let allocate_instance = rb_class_allocate_instance as * mut u8 ;
1992
+ let custom_allocator = unsafe { rb_get_alloc_func ( comptime_val_klass) . unwrap ( ) as * const u8 } ;
1993
+ let allocate_instance = rb_class_allocate_instance as * const u8 ;
2004
1994
2005
1995
// If the class uses the default allocator, instances should all be T_OBJECT
2006
1996
// NOTE: This assumes nobody changes the allocator of the class after allocation.
@@ -2017,8 +2007,7 @@ fn gen_get_ivar(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
2017
2007
2018
2008
mov ( cb, C_ARG_REGS [ 0 ] , REG0 ) ;
2019
2009
mov ( cb, C_ARG_REGS [ 1 ] , uimm_opnd ( ivar_name) ) ;
2020
- let ivar_get = CodePtr :: from ( rb_ivar_get as * mut u8 ) ;
2021
- call_ptr ( cb, REG1 , ivar_get) ;
2010
+ call_ptr ( cb, REG1 , rb_ivar_get as * const u8 ) ;
2022
2011
2023
2012
if reg0_opnd != InsnOpnd :: SelfOpnd {
2024
2013
ctx. stack_pop ( 1 ) ;
@@ -2171,8 +2160,7 @@ fn gen_setinstancevariable(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeB
2171
2160
mov ( cb, C_ARG_REGS [ 4 ] , const_ptr_opnd ( ic as * const u8 ) ) ;
2172
2161
let iseq = VALUE ( jit. iseq as usize ) ;
2173
2162
jit_mov_gc_ptr ( jit, cb, C_ARG_REGS [ 0 ] , iseq) ;
2174
- let vm_setinstancevar = CodePtr :: from ( rb_vm_setinstancevariable as * mut u8 ) ;
2175
- call_ptr ( cb, REG0 , vm_setinstancevar) ;
2163
+ call_ptr ( cb, REG0 , rb_vm_setinstancevariable as * const u8 ) ;
2176
2164
2177
2165
KeepCompiling
2178
2166
}
@@ -2196,8 +2184,7 @@ fn gen_defined(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
2196
2184
mov ( cb, C_ARG_REGS [ 2 ] , uimm_opnd ( op_type. into ( ) ) ) ;
2197
2185
jit_mov_gc_ptr ( jit, cb, C_ARG_REGS [ 3 ] , obj) ;
2198
2186
mov ( cb, C_ARG_REGS [ 4 ] , v_opnd) ;
2199
- let vm_defined = CodePtr :: from ( rb_vm_defined as * mut u8 ) ;
2200
- call_ptr ( cb, REG0 , vm_defined) ;
2187
+ call_ptr ( cb, REG0 , rb_vm_defined as * const u8 ) ;
2201
2188
2202
2189
// if (vm_defined(ec, GET_CFP(), op_type, obj, v)) {
2203
2190
// val = pushval;
@@ -2286,8 +2273,7 @@ fn gen_concatstrings(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock,
2286
2273
// call rb_str_concat_literals(long n, const VALUE *strings);
2287
2274
mov ( cb, C_ARG_REGS [ 0 ] , imm_opnd ( n. into ( ) ) ) ;
2288
2275
lea ( cb, C_ARG_REGS [ 1 ] , values_ptr) ;
2289
- let str_concat_literals = CodePtr :: from ( rb_str_concat_literals as * mut u8 ) ;
2290
- call_ptr ( cb, REG0 , str_concat_literals) ;
2276
+ call_ptr ( cb, REG0 , rb_str_concat_literals as * const u8 ) ;
2291
2277
2292
2278
ctx. stack_pop ( n. as_usize ( ) ) ;
2293
2279
let stack_ret = ctx. stack_push ( Type :: String ) ;
@@ -2485,8 +2471,7 @@ fn gen_equality_specialized(jit: &mut JITState, ctx: &mut Context, cb: &mut Code
2485
2471
}
2486
2472
2487
2473
// Call rb_str_eql_internal(a, b)
2488
- let str_eql = CodePtr ::from ( rb_str_eql_internal as * mut u8 ) ;
2489
- call_ptr ( cb, REG0 , str_eql) ;
2474
+ call_ptr ( cb, REG0 , rb_str_eql_internal as * const u8 ) ;
2490
2475
2491
2476
// Push the output on the stack
2492
2477
cb. write_label ( ret) ;
@@ -2893,8 +2878,7 @@ fn gen_opt_mod(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
2893
2878
// Call rb_vm_opt_mod(VALUE recv, VALUE obj)
2894
2879
mov ( cb, C_ARG_REGS [ 0 ] , arg0) ;
2895
2880
mov ( cb, C_ARG_REGS [ 1 ] , arg1) ;
2896
- let vm_mod = CodePtr :: from ( rb_vm_opt_mod as * mut u8 ) ;
2897
- call_ptr ( cb, REG0 , vm_mod) ;
2881
+ call_ptr ( cb, REG0 , rb_vm_opt_mod as * const u8 ) ;
2898
2882
2899
2883
// If val == Qundef, bail to do a method call
2900
2884
cmp ( cb, RAX , imm_opnd ( Qundef . as_i64 ( ) ) ) ;
@@ -4731,8 +4715,7 @@ fn gen_getglobal(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
4731
4715
4732
4716
mov ( cb, C_ARG_REGS [ 0 ] , imm_opnd ( gid. as_i64 ( ) ) ) ;
4733
4717
4734
- let gvar_get = CodePtr :: from ( rb_gvar_get as * mut u8 ) ;
4735
- call_ptr ( cb, REG0 , gvar_get) ;
4718
+ call_ptr ( cb, REG0 , rb_gvar_get as * const u8 ) ;
4736
4719
4737
4720
let top = ctx. stack_push ( Type :: Unknown ) ;
4738
4721
mov ( cb, top, RAX ) ;
@@ -4754,8 +4737,7 @@ fn gen_setglobal(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb:
4754
4737
4755
4738
mov ( cb, C_ARG_REGS [ 1 ] , val) ;
4756
4739
4757
- let gvar_set = CodePtr :: from ( rb_gvar_set as * mut u8 ) ;
4758
- call_ptr ( cb, REG0 , gvar_set) ;
4740
+ call_ptr ( cb, REG0 , rb_gvar_set as * const u8 ) ;
4759
4741
4760
4742
KeepCompiling
4761
4743
}
0 commit comments