@@ -34,7 +34,7 @@ typedef struct _Py_UOpsAbstractFrame _Py_UOpsAbstractFrame;
3434#define sym_new_tuple _Py_uop_sym_new_tuple
3535#define sym_tuple_getitem _Py_uop_sym_tuple_getitem
3636#define sym_tuple_length _Py_uop_sym_tuple_length
37- #define sym_is_immortal _Py_uop_sym_is_immortal
37+ #define sym_is_immortal _Py_uop_symbol_is_immortal
3838#define sym_new_compact_int _Py_uop_sym_new_compact_int
3939#define sym_is_compact_int _Py_uop_sym_is_compact_int
4040#define sym_new_truthiness _Py_uop_sym_new_truthiness
@@ -535,15 +535,15 @@ dummy_func(void) {
535535 }
536536
537537 op (_LOAD_CONST_INLINE , (ptr /4 -- value )) {
538- value = PyJitRef_Borrow ( sym_new_const (ctx , ptr ) );
538+ value = sym_new_const (ctx , ptr );
539539 }
540540
541541 op (_LOAD_CONST_INLINE_BORROW , (ptr /4 -- value )) {
542542 value = PyJitRef_Borrow (sym_new_const (ctx , ptr ));
543543 }
544544
545545 op (_POP_TOP_LOAD_CONST_INLINE , (ptr /4 , pop -- value )) {
546- value = PyJitRef_Borrow ( sym_new_const (ctx , ptr ) );
546+ value = sym_new_const (ctx , ptr );
547547 }
548548
549549 op (_POP_TOP_LOAD_CONST_INLINE_BORROW , (ptr /4 , pop -- value )) {
@@ -564,9 +564,8 @@ dummy_func(void) {
564564
565565 op (_POP_TOP , (value -- )) {
566566 PyTypeObject * typ = sym_get_type (value );
567- PyObject * const_val = sym_get_const (ctx , value );
568567 if (PyJitRef_IsBorrowed (value ) ||
569- sym_is_immortal (value ) ||
568+ sym_is_immortal (PyJitRef_Unwrap ( value ) ) ||
570569 sym_is_null (value )) {
571570 REPLACE_OP (this_instr , _POP_TOP_NOP , 0 , 0 );
572571 }
@@ -823,7 +822,9 @@ dummy_func(void) {
823822 }
824823
825824 op (_RETURN_VALUE , (retval -- res )) {
826- JitOptRef temp = retval ;
825+ // We wrap and unwrap the value to mimic PyStackRef_MakeHeapSafe
826+ // in bytecodes.c
827+ JitOptRef temp = PyJitRef_Wrap (PyJitRef_Unwrap (retval ));
827828 DEAD (retval );
828829 SAVE_STACK ();
829830 ctx -> frame -> stack_pointer = stack_pointer ;
0 commit comments