@@ -811,7 +811,7 @@ do_specialize_instance_load_attr(PyObject* owner, _Py_CODEUNIT* instr, PyObject*
811811 return -1 ;
812812 }
813813 /* Don't specialize if PEP 523 is active */
814- if (_PyInterpreterState_GET ()-> eval_frame ) {
814+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
815815 SPECIALIZATION_FAIL (LOAD_ATTR , SPEC_FAIL_OTHER );
816816 return -1 ;
817817 }
@@ -890,7 +890,7 @@ do_specialize_instance_load_attr(PyObject* owner, _Py_CODEUNIT* instr, PyObject*
890890 return -1 ;
891891 }
892892 /* Don't specialize if PEP 523 is active */
893- if (_PyInterpreterState_GET ()-> eval_frame ) {
893+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
894894 SPECIALIZATION_FAIL (LOAD_ATTR , SPEC_FAIL_OTHER );
895895 return -1 ;
896896 }
@@ -1697,7 +1697,7 @@ specialize_py_call(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs,
16971697 PyCodeObject * code = (PyCodeObject * )func -> func_code ;
16981698 int kind = function_kind (code );
16991699 /* Don't specialize if PEP 523 is active */
1700- if (_PyInterpreterState_GET ()-> eval_frame ) {
1700+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
17011701 SPECIALIZATION_FAIL (CALL , SPEC_FAIL_CALL_PEP_523 );
17021702 return -1 ;
17031703 }
@@ -1740,7 +1740,7 @@ specialize_py_call_kw(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs,
17401740 PyCodeObject * code = (PyCodeObject * )func -> func_code ;
17411741 int kind = function_kind (code );
17421742 /* Don't specialize if PEP 523 is active */
1743- if (_PyInterpreterState_GET ()-> eval_frame ) {
1743+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
17441744 SPECIALIZATION_FAIL (CALL , SPEC_FAIL_CALL_PEP_523 );
17451745 return -1 ;
17461746 }
@@ -2003,7 +2003,7 @@ binary_op_fail_kind(int oparg, PyObject *lhs, PyObject *rhs)
20032003 return SPEC_FAIL_WRONG_NUMBER_ARGUMENTS ;
20042004 }
20052005
2006- if (_PyInterpreterState_GET ()-> eval_frame ) {
2006+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
20072007 /* Don't specialize if PEP 523 is active */
20082008 Py_DECREF (descriptor );
20092009 return SPEC_FAIL_OTHER ;
@@ -2312,7 +2312,7 @@ _Py_Specialize_BinaryOp(_PyStackRef lhs_st, _PyStackRef rhs_st, _Py_CODEUNIT *in
23122312 PyHeapTypeObject * ht = (PyHeapTypeObject * )container_type ;
23132313 if (kind == SIMPLE_FUNCTION &&
23142314 fcode -> co_argcount == 2 &&
2315- ! _PyInterpreterState_GET ()-> eval_frame && /* Don't specialize if PEP 523 is active */
2315+ _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) && /* Don't specialize if PEP 523 is active */
23162316 _PyType_CacheGetItemForSpecialization (ht , descriptor , (uint32_t )tp_version ))
23172317 {
23182318 specialize (instr , BINARY_OP_SUBSCR_GETITEM );
@@ -2570,7 +2570,7 @@ _Py_Specialize_ForIter(_PyStackRef iter, _PyStackRef null_or_index, _Py_CODEUNIT
25702570 instr [oparg + INLINE_CACHE_ENTRIES_FOR_ITER + 1 ].op .code == INSTRUMENTED_END_FOR
25712571 );
25722572 /* Don't specialize if PEP 523 is active */
2573- if (_PyInterpreterState_GET ()-> eval_frame ) {
2573+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
25742574 goto failure ;
25752575 }
25762576 specialize (instr , FOR_ITER_GEN );
@@ -2609,7 +2609,7 @@ _Py_Specialize_Send(_PyStackRef receiver_st, _Py_CODEUNIT *instr)
26092609 PyTypeObject * tp = Py_TYPE (receiver );
26102610 if (tp == & PyGen_Type || tp == & PyCoro_Type ) {
26112611 /* Don't specialize if PEP 523 is active */
2612- if (_PyInterpreterState_GET ()-> eval_frame ) {
2612+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
26132613 SPECIALIZATION_FAIL (SEND , SPEC_FAIL_OTHER );
26142614 goto failure ;
26152615 }
@@ -2632,7 +2632,7 @@ _Py_Specialize_CallFunctionEx(_PyStackRef func_st, _Py_CODEUNIT *instr)
26322632
26332633 if (Py_TYPE (func ) == & PyFunction_Type &&
26342634 ((PyFunctionObject * )func )-> vectorcall == _PyFunction_Vectorcall ) {
2635- if (_PyInterpreterState_GET ()-> eval_frame ) {
2635+ if (! _PyInterpreterState_IsSpecializationEnabled ( _PyInterpreterState_GET ()) ) {
26362636 goto failure ;
26372637 }
26382638 specialize (instr , CALL_EX_PY );
0 commit comments