#ifndef Py_INTERNAL_FRAME_H
#define Py_INTERNAL_FRAME_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include <stdbool.h>
#include <stddef.h>
#include "pycore_code.h"
#include "pycore_stackref.h"
struct _frame { … };
extern PyFrameObject* _PyFrame_New_NoTrack(PyCodeObject *code);
PyFrameState;
#define FRAME_STATE_SUSPENDED(S) …
#define FRAME_STATE_FINISHED(S) …
enum _frameowner { … };
_PyInterpreterFrame;
#define _PyInterpreterFrame_LASTI(IF) …
static inline PyCodeObject *_PyFrame_GetCode(_PyInterpreterFrame *f) { … }
static inline _Py_CODEUNIT *
_PyFrame_GetBytecode(_PyInterpreterFrame *f)
{ … }
static inline PyFunctionObject *_PyFrame_GetFunction(_PyInterpreterFrame *f) { … }
static inline _PyStackRef *_PyFrame_Stackbase(_PyInterpreterFrame *f) { … }
static inline _PyStackRef _PyFrame_StackPeek(_PyInterpreterFrame *f) { … }
static inline _PyStackRef _PyFrame_StackPop(_PyInterpreterFrame *f) { … }
static inline void _PyFrame_StackPush(_PyInterpreterFrame *f, _PyStackRef value) { … }
#define FRAME_SPECIALS_SIZE …
static inline int
_PyFrame_NumSlotsForCodeObject(PyCodeObject *code)
{ … }
static inline void _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest)
{ … }
#ifdef Py_GIL_DISABLED
static inline void
_PyFrame_InitializeTLBC(PyThreadState *tstate, _PyInterpreterFrame *frame,
PyCodeObject *code)
{
_Py_CODEUNIT *tlbc = _PyCode_GetTLBCFast(tstate, code);
if (tlbc == NULL) {
frame->instr_ptr = _PyCode_CODE(code);
frame->tlbc_index = 0;
}
else {
frame->instr_ptr = tlbc;
frame->tlbc_index = ((_PyThreadStateImpl *)tstate)->tlbc_index;
}
}
#endif
static inline void
_PyFrame_Initialize(
PyThreadState *tstate, _PyInterpreterFrame *frame, _PyStackRef func,
PyObject *locals, PyCodeObject *code, int null_locals_from, _PyInterpreterFrame *previous)
{ … }
static inline _PyStackRef*
_PyFrame_GetLocalsArray(_PyInterpreterFrame *frame)
{ … }
static inline _PyStackRef*
_PyFrame_GetStackPointer(_PyInterpreterFrame *frame)
{ … }
static inline void
_PyFrame_SetStackPointer(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer)
{ … }
static inline bool
_PyFrame_IsIncomplete(_PyInterpreterFrame *frame)
{ … }
static inline _PyInterpreterFrame *
_PyFrame_GetFirstComplete(_PyInterpreterFrame *frame)
{ … }
static inline _PyInterpreterFrame *
_PyThreadState_GetFrame(PyThreadState *tstate)
{ … }
PyFrameObject *
_PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame);
static inline PyFrameObject *
_PyFrame_GetFrameObject(_PyInterpreterFrame *frame)
{ … }
void
_PyFrame_ClearLocals(_PyInterpreterFrame *frame);
void
_PyFrame_ClearExceptCode(_PyInterpreterFrame * frame);
int
_PyFrame_Traverse(_PyInterpreterFrame *frame, visitproc visit, void *arg);
bool
_PyFrame_HasHiddenLocals(_PyInterpreterFrame *frame);
PyObject *
_PyFrame_GetLocals(_PyInterpreterFrame *frame);
static inline bool
_PyThreadState_HasStackSpace(PyThreadState *tstate, int size)
{ … }
extern _PyInterpreterFrame *
_PyThreadState_PushFrame(PyThreadState *tstate, size_t size);
PyAPI_FUNC(void) _PyThreadState_PopFrame(PyThreadState *tstate, _PyInterpreterFrame *frame);
static inline _PyInterpreterFrame *
_PyFrame_PushUnchecked(PyThreadState *tstate, _PyStackRef func, int null_locals_from, _PyInterpreterFrame * previous)
{ … }
static inline _PyInterpreterFrame *
_PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int stackdepth, _PyInterpreterFrame * previous)
{ … }
PyAPI_FUNC(_PyInterpreterFrame *)
_PyEvalFramePushAndInit(PyThreadState *tstate, _PyStackRef func,
PyObject *locals, _PyStackRef const* args,
size_t argcount, PyObject *kwnames,
_PyInterpreterFrame *previous);
#ifdef __cplusplus
}
#endif
#endif