mirror of
https://github.com/python/cpython.git
synced 2025-10-25 10:44:55 +00:00
GH-136410: Faster side exits by using a cold exit stub (GH-136411)
This commit is contained in:
parent
718e0c89ba
commit
e7b55f564d
15 changed files with 387 additions and 267 deletions
|
|
@ -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;
|
||||
|
|
@ -354,6 +355,16 @@ 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);
|
||||
|
||||
PyAPI_FUNC(void) _PyExecutor_ClearExit(_PyExitData *exit);
|
||||
|
||||
static inline int is_terminator(const _PyUOpInstruction *uop)
|
||||
{
|
||||
int opcode = uop->opcode;
|
||||
|
|
@ -363,6 +374,8 @@ static inline int is_terminator(const _PyUOpInstruction *uop)
|
|||
);
|
||||
}
|
||||
|
||||
extern void _PyExecutor_Free(_PyExecutorObject *self);
|
||||
|
||||
PyAPI_FUNC(int) _PyDumpExecutors(FILE *out);
|
||||
#ifdef _Py_TIER2
|
||||
extern void _Py_ClearExecutorDeletionList(PyInterpreterState *interp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue