gh-139109: Dynamic opcode targets (GH-139111)

Make opcode targets table dynamic
This commit is contained in:
Ken Jin 2025-09-18 21:12:07 +08:00 committed by GitHub
parent 243d599a05
commit a269e691de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 17 deletions

View file

@ -1,5 +1,5 @@
#if !_Py_TAIL_CALL_INTERP
static void *opcode_targets[256] = {
static void *opcode_targets_table[256] = {
&&TARGET_CACHE,
&&TARGET_BINARY_SLICE,
&&TARGET_BUILD_TEMPLATE,
@ -258,7 +258,7 @@ static void *opcode_targets[256] = {
&&TARGET_ENTER_EXECUTOR,
};
#else /* _Py_TAIL_CALL_INTERP */
static py_tail_call_funcptr INSTRUCTION_TABLE[256];
static py_tail_call_funcptr instruction_funcptr_table[256];
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_2_error(TAIL_CALL_PARAMS);
Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_1_error(TAIL_CALL_PARAMS);
@ -503,7 +503,7 @@ Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_UNKNOWN_OPCODE(TAIL_CALL_PARAMS)
JUMP_TO_LABEL(error);
}
static py_tail_call_funcptr INSTRUCTION_TABLE[256] = {
static py_tail_call_funcptr instruction_funcptr_table[256] = {
[BINARY_OP] = _TAIL_CALL_BINARY_OP,
[BINARY_OP_ADD_FLOAT] = _TAIL_CALL_BINARY_OP_ADD_FLOAT,
[BINARY_OP_ADD_INT] = _TAIL_CALL_BINARY_OP_ADD_INT,