GH-122390: Replace _Py_GetbaseOpcode with _Py_GetBaseCodeUnit (GH-122942)

This commit is contained in:
Mark Shannon 2024-08-13 14:22:57 +01:00 committed by GitHub
parent fe23f8ed97
commit 7a65439b93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 299 additions and 326 deletions

View file

@ -428,9 +428,9 @@ _PyCode_Quicken(PyCodeObject *code)
#if ENABLE_SPECIALIZATION
int opcode = 0;
_Py_CODEUNIT *instructions = _PyCode_CODE(code);
for (int i = 0; i < Py_SIZE(code); i++) {
opcode = _Py_GetBaseOpcode(code, i);
assert(opcode < MIN_INSTRUMENTED_OPCODE);
/* The last code unit cannot have a cache, so we don't need to check it */
for (int i = 0; i < Py_SIZE(code)-1; i++) {
opcode = instructions[i].op.code;
int caches = _PyOpcode_Caches[opcode];
if (caches) {
// The initial value depends on the opcode