Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Include/cpython/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ struct _ts {

PyObject *current_executor;

/* Internal to the JIT */
struct _PyExitData *jit_exit;

uint64_t dict_global_version;

/* Used to store/retrieve `threading.local` keys/values for this thread */
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_interp_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ struct _is {
bool jit;
struct _PyExecutorObject *executor_list_head;
struct _PyExecutorObject *executor_deletion_list_head;
struct _PyExecutorObject *cold_executor;
int executor_deletion_list_remaining_capacity;
size_t trace_run_counter;
_rare_events rare_events;
Expand Down
11 changes: 10 additions & 1 deletion Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ typedef struct {
#endif
} _PyUOpInstruction;

typedef struct {
typedef struct _PyExitData {
uint32_t target;
uint16_t index;
_Py_BackoffCounter temperature;
struct _PyExecutorObject *executor;
} _PyExitData;
Expand Down Expand Up @@ -354,6 +355,14 @@ PyAPI_FUNC(PyObject *) _Py_uop_symbols_test(PyObject *self, PyObject *ignored);

PyAPI_FUNC(int) _PyOptimizer_Optimize(_PyInterpreterFrame *frame, _Py_CODEUNIT *start, _PyExecutorObject **exec_ptr, int chain_depth);

static inline _PyExecutorObject *_PyExecutor_FromExit(_PyExitData *exit)
{
_PyExitData *exit0 = exit - exit->index;
return (_PyExecutorObject *)(((char *)exit0) - offsetof(_PyExecutorObject, exits));
}

extern _PyExecutorObject *_PyExecutor_GetColdExecutor(void);

static inline int is_terminator(const _PyUOpInstruction *uop)
{
int opcode = uop->opcode;
Expand Down
Loading
Loading