Skip to content

Commit 4391c5f

Browse files
committed
Use cfp->_iseq directly in GET_ISEQ() macro
The interpreter always has a valid _iseq field (it's written on exit from JIT code), so GET_ISEQ() doesn't need to go through rb_cfp_iseq(). Code in vm_insnhelper.c that may be called as a ZJIT fallback should use rb_cfp_iseq() instead.
1 parent 226f370 commit 4391c5f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

vm_insnhelper.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ enum vm_regan_acttype {
113113
#define SET_SV(x) (*GET_SP() = rb_ractor_confirm_belonging(x))
114114
/* set current stack value as x */
115115

116-
/* instruction sequence C struct */
117-
#define GET_ISEQ() (rb_cfp_iseq(GET_CFP()))
116+
// instruction sequence C struct
117+
// Uses cfp->_iseq directly because the interpreter always has a valid _iseq
118+
// field (it's written on exit from JIT code). Code in vm_insnhelper.c that
119+
// may be called as a ZJIT fallback should use rb_cfp_iseq() instead.
120+
#define GET_ISEQ() (GET_CFP()->_iseq)
118121

119122
/**********************************************************/
120123
/* deal with variables */

0 commit comments

Comments
 (0)