@@ -1834,6 +1834,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
18341834 let pc = unsafe { rb_iseq_pc_at_idx ( iseq, insn_idx) } ;
18351835 state. pc = pc;
18361836 let exit_state = state. clone ( ) ;
1837+ profiles. profile_stack ( & exit_state) ;
18371838
18381839 // try_into() call below is unfortunate. Maybe pick i32 instead of usize for opcodes.
18391840 let opcode: u32 = unsafe { rb_iseq_opcode_at_pc ( iseq, pc) }
@@ -2015,7 +2016,6 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
20152016
20162017 let recv = state. stack_pop ( ) ?;
20172018 let exit_id = fun. push_insn ( block, Insn :: Snapshot { state : exit_state. clone ( ) } ) ;
2018- profiles. profile_stack ( & exit_state) ;
20192019 let send = fun. push_insn ( block, Insn :: SendWithoutBlock { self_val : recv, call_info : CallInfo { method_name } , cd, args, state : exit_id } ) ;
20202020 state. stack_push ( send) ;
20212021 }
@@ -2059,7 +2059,6 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
20592059
20602060 let recv = state. stack_pop ( ) ?;
20612061 let exit_id = fun. push_insn ( block, Insn :: Snapshot { state : exit_state. clone ( ) } ) ;
2062- profiles. profile_stack ( & exit_state) ;
20632062 let send = fun. push_insn ( block, Insn :: SendWithoutBlock { self_val : recv, call_info : CallInfo { method_name } , cd, args, state : exit_id } ) ;
20642063 state. stack_push ( send) ;
20652064 }
@@ -2082,7 +2081,6 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
20822081
20832082 let recv = state. stack_pop ( ) ?;
20842083 let exit_id = fun. push_insn ( block, Insn :: Snapshot { state : exit_state. clone ( ) } ) ;
2085- profiles. profile_stack ( & exit_state) ;
20862084 let send = fun. push_insn ( block, Insn :: Send { self_val : recv, call_info : CallInfo { method_name } , cd, blockiseq, args, state : exit_id } ) ;
20872085 state. stack_push ( send) ;
20882086 }
0 commit comments