PyObject *receiver_o = PyStackRef_AsPyObjectBorrow(receiver);
PyObject *retval_o;
assert(frame->owner != FRAME_OWNED_BY_INTERPRETER);
- if ((tstate->interp->eval_frame == NULL) &&
+ if (!IS_PEP523_HOOKED(tstate) &&
(Py_TYPE(receiver_o) == &PyGen_Type || Py_TYPE(receiver_o) == &PyCoro_Type) &&
gen_try_set_executing((PyGenObject *)receiver_o))
{
PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner);
assert((oparg & 1) == 0);
- DEOPT_IF(tstate->interp->eval_frame);
+ DEOPT_IF(IS_PEP523_HOOKED(tstate));
PyTypeObject *cls = Py_TYPE(owner_o);
assert(type_version != 0);
DEOPT_IF(FT_ATOMIC_LOAD_UINT_RELAXED(cls->tp_version_tag) != type_version);
}
// Check if the call can be inlined or not
if (Py_TYPE(callable_o) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)callable_o)->vectorcall == _PyFunction_Vectorcall)
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
}
op(_CHECK_PEP_523, (--)) {
- DEOPT_IF(tstate->interp->eval_frame);
+ DEOPT_IF(IS_PEP523_HOOKED(tstate));
}
op(_CHECK_FUNCTION_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
}
op(_PUSH_FRAME, (new_frame -- )) {
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
DEAD(new_frame);
SYNC_SP();
int positional_args = total_args - (int)PyTuple_GET_SIZE(kwnames_o);
// Check if the call can be inlined or not
if (Py_TYPE(callable_o) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)callable_o)->vectorcall == _PyFunction_Vectorcall)
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
}
else {
if (Py_TYPE(func) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)func)->vectorcall == _PyFunction_Vectorcall) {
PyObject *callargs = PyStackRef_AsPyObjectSteal(callargs_st);
assert(PyTuple_CheckExact(callargs));
case _CHECK_PEP_523_r00: {
CHECK_CURRENT_CACHED_VALUES(0);
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UOP_STAT_INC(uopcode, miss);
SET_CURRENT_CACHED_VALUES(0);
JUMP_TO_JUMP_TARGET();
CHECK_CURRENT_CACHED_VALUES(1);
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
_PyStackRef _stack_item_0 = _tos_cache0;
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UOP_STAT_INC(uopcode, miss);
_tos_cache0 = _stack_item_0;
SET_CURRENT_CACHED_VALUES(1);
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
_PyStackRef _stack_item_0 = _tos_cache0;
_PyStackRef _stack_item_1 = _tos_cache1;
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UOP_STAT_INC(uopcode, miss);
_tos_cache1 = _stack_item_1;
_tos_cache0 = _stack_item_0;
_PyStackRef _stack_item_0 = _tos_cache0;
_PyStackRef _stack_item_1 = _tos_cache1;
_PyStackRef _stack_item_2 = _tos_cache2;
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UOP_STAT_INC(uopcode, miss);
_tos_cache2 = _stack_item_2;
_tos_cache1 = _stack_item_1;
_PyStackRef new_frame;
_PyStackRef _stack_item_0 = _tos_cache0;
new_frame = _stack_item_0;
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
/* Skip 5 cache entries */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(BINARY_OP);
assert(_PyOpcode_Deopt[opcode] == (BINARY_OP));
JUMP_TO_PREDICTED(BINARY_OP);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
stack_pointer += -2;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
total_args++;
}
if (Py_TYPE(callable_o) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)callable_o)->vectorcall == _PyFunction_Vectorcall)
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
// _PUSH_FRAME
{
new_frame = init_frame;
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
stack_pointer += -2 - oparg;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL_FUNCTION_EX);
assert(_PyOpcode_Deopt[opcode] == (CALL_FUNCTION_EX));
JUMP_TO_PREDICTED(CALL_FUNCTION_EX);
// _PUSH_FRAME
{
new_frame = ex_frame;
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
}
else {
if (Py_TYPE(func) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)func)->vectorcall == _PyFunction_Vectorcall) {
PyObject *callargs = PyStackRef_AsPyObjectSteal(callargs_st);
assert(PyTuple_CheckExact(callargs));
}
int positional_args = total_args - (int)PyTuple_GET_SIZE(kwnames_o);
if (Py_TYPE(callable_o) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)callable_o)->vectorcall == _PyFunction_Vectorcall)
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL_KW);
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
JUMP_TO_PREDICTED(CALL_KW);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL_KW);
assert(_PyOpcode_Deopt[opcode] == (CALL_KW));
JUMP_TO_PREDICTED(CALL_KW);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
stack_pointer += -2 - oparg;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(CALL);
assert(_PyOpcode_Deopt[opcode] == (CALL));
JUMP_TO_PREDICTED(CALL);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(FOR_ITER);
assert(_PyOpcode_Deopt[opcode] == (FOR_ITER));
JUMP_TO_PREDICTED(FOR_ITER);
// _PUSH_FRAME
{
new_frame = gen_frame;
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
_PyFrame_SetStackPointer(frame, stack_pointer);
assert(temp->previous == frame || temp->previous->previous == frame);
total_args++;
}
if (Py_TYPE(callable_o) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)callable_o)->vectorcall == _PyFunction_Vectorcall)
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
}
else {
if (Py_TYPE(func) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)func)->vectorcall == _PyFunction_Vectorcall) {
PyObject *callargs = PyStackRef_AsPyObjectSteal(callargs_st);
assert(PyTuple_CheckExact(callargs));
}
int positional_args = total_args - (int)PyTuple_GET_SIZE(kwnames_o);
if (Py_TYPE(callable_o) == &PyFunction_Type &&
- tstate->interp->eval_frame == NULL &&
+ !IS_PEP523_HOOKED(tstate) &&
((PyFunctionObject *)callable_o)->vectorcall == _PyFunction_Vectorcall)
{
int code_flags = ((PyCodeObject*)PyFunction_GET_CODE(callable_o))->co_flags;
PyObject *getattribute = read_obj(&this_instr[6].cache);
PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner);
assert((oparg & 1) == 0);
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(LOAD_ATTR);
assert(_PyOpcode_Deopt[opcode] == (LOAD_ATTR));
JUMP_TO_PREDICTED(LOAD_ATTR);
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(LOAD_ATTR);
assert(_PyOpcode_Deopt[opcode] == (LOAD_ATTR));
JUMP_TO_PREDICTED(LOAD_ATTR);
}
// _PUSH_FRAME
{
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
stack_pointer += -1;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
PyObject *receiver_o = PyStackRef_AsPyObjectBorrow(receiver);
PyObject *retval_o;
assert(frame->owner != FRAME_OWNED_BY_INTERPRETER);
- if ((tstate->interp->eval_frame == NULL) &&
+ if (!IS_PEP523_HOOKED(tstate) &&
(Py_TYPE(receiver_o) == &PyGen_Type || Py_TYPE(receiver_o) == &PyCoro_Type) &&
gen_try_set_executing((PyGenObject *)receiver_o))
{
/* Skip 1 cache entry */
// _CHECK_PEP_523
{
- if (tstate->interp->eval_frame) {
+ if (IS_PEP523_HOOKED(tstate)) {
UPDATE_MISS_STATS(SEND);
assert(_PyOpcode_Deopt[opcode] == (SEND));
JUMP_TO_PREDICTED(SEND);
// _PUSH_FRAME
{
new_frame = gen_frame;
- assert(tstate->interp->eval_frame == NULL);
+ assert(!IS_PEP523_HOOKED(tstate));
_PyInterpreterFrame *temp = PyStackRef_Unwrap(new_frame);
stack_pointer += -1;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);