mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
gh-139109: Dynamic opcode targets (GH-139111)
Make opcode targets table dynamic
This commit is contained in:
parent
243d599a05
commit
a269e691de
5 changed files with 19 additions and 17 deletions
|
|
@ -1022,6 +1022,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
|
|||
#if USE_COMPUTED_GOTOS && !_Py_TAIL_CALL_INTERP
|
||||
/* Import the static jump table */
|
||||
#include "opcode_targets.h"
|
||||
void **opcode_targets = opcode_targets_table;
|
||||
#endif
|
||||
|
||||
#ifdef Py_STATS
|
||||
|
|
@ -1101,9 +1102,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
|
|||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
# if Py_STATS
|
||||
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, 0, lastopcode);
|
||||
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, instruction_funcptr_table, 0, lastopcode);
|
||||
# else
|
||||
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, 0);
|
||||
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, instruction_funcptr_table, 0);
|
||||
# endif
|
||||
#else
|
||||
goto error;
|
||||
|
|
@ -1112,9 +1113,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
|
|||
|
||||
#if _Py_TAIL_CALL_INTERP
|
||||
# if Py_STATS
|
||||
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, 0, lastopcode);
|
||||
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, instruction_funcptr_table, 0, lastopcode);
|
||||
# else
|
||||
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, 0);
|
||||
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, instruction_funcptr_table, 0);
|
||||
# endif
|
||||
#else
|
||||
goto start_frame;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue