mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-133231: Changes to executor management to support proposed sys._jit
module (GH-133287)
* Track the current executor, not the previous one, on the thread-state. * Batch executors for deallocation to avoid having to constantly incref executors; this is an ad-hoc form of deferred reference counting.
This commit is contained in:
parent
1d9406e426
commit
ac7d5ba96e
13 changed files with 176 additions and 54 deletions
|
@ -50,13 +50,16 @@
|
|||
#define GOTO_TIER_TWO(EXECUTOR) \
|
||||
do { \
|
||||
OPT_STAT_INC(traces_executed); \
|
||||
jit_func_preserve_none jitted = (EXECUTOR)->jit_side_entry; \
|
||||
_PyExecutorObject *_executor = (EXECUTOR); \
|
||||
tstate->current_executor = (PyObject *)_executor; \
|
||||
jit_func_preserve_none jitted = _executor->jit_side_entry; \
|
||||
__attribute__((musttail)) return jitted(frame, stack_pointer, tstate); \
|
||||
} while (0)
|
||||
|
||||
#undef GOTO_TIER_ONE
|
||||
#define GOTO_TIER_ONE(TARGET) \
|
||||
do { \
|
||||
tstate->current_executor = NULL; \
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer); \
|
||||
return TARGET; \
|
||||
} while (0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue