@@ -1497,23 +1497,24 @@ fn can_direct_send(function: &mut Function, block: BlockId, iseq: *const rb_iseq
14971497 can_send = false ;
14981498 function. push_insn ( block, Insn :: IncrCounter ( counter) ) ;
14991499 } ;
1500+ let params = unsafe { iseq. params ( ) } ;
15001501
15011502 use Counter :: * ;
1502- if unsafe { rb_get_iseq_flags_has_rest ( iseq ) } { count_failure ( complex_arg_pass_param_rest) }
1503- if unsafe { rb_get_iseq_flags_has_post ( iseq ) } { count_failure ( complex_arg_pass_param_post) }
1504- if unsafe { rb_get_iseq_flags_has_kw ( iseq ) } { count_failure ( complex_arg_pass_param_kw) }
1505- if unsafe { rb_get_iseq_flags_has_kwrest ( iseq ) } { count_failure ( complex_arg_pass_param_kwrest) }
1506- if unsafe { rb_get_iseq_flags_has_block ( iseq ) } { count_failure ( complex_arg_pass_param_block) }
1507- if unsafe { rb_get_iseq_flags_forwardable ( iseq ) } { count_failure ( complex_arg_pass_param_forwardable) }
1503+ if 0 != params . flags . has_rest ( ) { count_failure ( complex_arg_pass_param_rest) }
1504+ if 0 != params . flags . has_post ( ) { count_failure ( complex_arg_pass_param_post) }
1505+ if 0 != params . flags . has_kw ( ) { count_failure ( complex_arg_pass_param_kw) }
1506+ if 0 != params . flags . has_kwrest ( ) { count_failure ( complex_arg_pass_param_kwrest) }
1507+ if 0 != params . flags . has_block ( ) { count_failure ( complex_arg_pass_param_block) }
1508+ if 0 != params . flags . forwardable ( ) { count_failure ( complex_arg_pass_param_forwardable) }
15081509
15091510 if !can_send {
15101511 function. set_dynamic_send_reason ( send_insn, ComplexArgPass ) ;
15111512 return false ;
15121513 }
15131514
15141515 // Because we exclude e.g. post parameters above, they are also excluded from the sum below.
1515- let lead_num = unsafe { get_iseq_body_param_lead_num ( iseq ) } ;
1516- let opt_num = unsafe { get_iseq_body_param_opt_num ( iseq ) } ;
1516+ let lead_num = params . lead_num ;
1517+ let opt_num = params . opt_num ;
15171518 can_send = c_int:: try_from ( args. len ( ) )
15181519 . as_ref ( )
15191520 . map ( |argc| ( lead_num..=lead_num + opt_num) . contains ( argc) )
@@ -2086,8 +2087,9 @@ impl Function {
20862087 /// Set self.param_types. They are copied to the param types of jit_entry_blocks.
20872088 fn set_param_types ( & mut self ) {
20882089 let iseq = self . iseq ;
2089- let param_size = unsafe { get_iseq_body_param_size ( iseq) } . to_usize ( ) ;
2090- let rest_param_idx = iseq_rest_param_idx ( iseq) ;
2090+ let params = unsafe { iseq. params ( ) } ;
2091+ let param_size = params. size . to_usize ( ) ;
2092+ let rest_param_idx = iseq_rest_param_idx ( params) ;
20912093
20922094 self . param_types . push ( types:: BasicObject ) ; // self
20932095 for local_idx in 0 ..param_size {
@@ -4596,11 +4598,12 @@ fn insn_idx_at_offset(idx: u32, offset: i64) -> u32 {
45964598/// List of insn_idx that starts a JIT entry block
45974599pub fn jit_entry_insns ( iseq : IseqPtr ) -> Vec < u32 > {
45984600 // TODO(alan): Make an iterator type for this instead of copying all of the opt_table each call
4599- let opt_num = unsafe { get_iseq_body_param_opt_num ( iseq) } ;
4601+ let params = unsafe { iseq. params ( ) } ;
4602+ let opt_num = params. opt_num ;
46004603 if opt_num > 0 {
46014604 let mut result = vec ! [ ] ;
46024605
4603- let opt_table = unsafe { get_iseq_body_param_opt_table ( iseq ) } ; // `opt_num + 1` entries
4606+ let opt_table = params . opt_table ; // `opt_num + 1` entries
46044607 for opt_idx in 0 ..=opt_num as isize {
46054608 let insn_idx = unsafe { opt_table. offset ( opt_idx) . read ( ) . as_u32 ( ) } ;
46064609 result. push ( insn_idx) ;
@@ -5715,8 +5718,9 @@ fn compile_entry_state(fun: &mut Function) -> (InsnId, FrameState) {
57155718 fun. push_insn ( entry_block, Insn :: EntryPoint { jit_entry_idx : None } ) ;
57165719
57175720 let iseq = fun. iseq ;
5718- let param_size = unsafe { get_iseq_body_param_size ( iseq) } . to_usize ( ) ;
5719- let rest_param_idx = iseq_rest_param_idx ( iseq) ;
5721+ let params = unsafe { iseq. params ( ) } ;
5722+ let param_size = params. size . to_usize ( ) ;
5723+ let rest_param_idx = iseq_rest_param_idx ( params) ;
57205724
57215725 let self_param = fun. push_insn ( entry_block, Insn :: LoadSelf ) ;
57225726 let mut entry_state = FrameState :: new ( iseq) ;
@@ -5748,9 +5752,10 @@ fn compile_jit_entry_block(fun: &mut Function, jit_entry_idx: usize, target_bloc
57485752/// Compile params and initial locals for a jit_entry_block
57495753fn compile_jit_entry_state ( fun : & mut Function , jit_entry_block : BlockId , jit_entry_idx : usize ) -> ( InsnId , FrameState ) {
57505754 let iseq = fun. iseq ;
5751- let param_size = unsafe { get_iseq_body_param_size ( iseq) } . to_usize ( ) ;
5752- let opt_num: usize = unsafe { get_iseq_body_param_opt_num ( iseq) } . try_into ( ) . expect ( "iseq param opt_num >= 0" ) ;
5753- let lead_num: usize = unsafe { get_iseq_body_param_lead_num ( iseq) } . try_into ( ) . expect ( "iseq param lead_num >= 0" ) ;
5755+ let params = unsafe { iseq. params ( ) } ;
5756+ let param_size = params. size . to_usize ( ) ;
5757+ let opt_num: usize = params. opt_num . try_into ( ) . expect ( "iseq param opt_num >= 0" ) ;
5758+ let lead_num: usize = params. lead_num . try_into ( ) . expect ( "iseq param lead_num >= 0" ) ;
57545759 let passed_opt_num = jit_entry_idx;
57555760
57565761 let self_param = fun. push_insn ( jit_entry_block, Insn :: Param ) ;
0 commit comments