bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)

This commit is contained in:
Brandt Bucher 2022-03-11 16:31:50 -08:00 committed by GitHub
parent 882d8096c2
commit a89c29fbcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 81 deletions

View file

@ -5517,7 +5517,7 @@ opname ## _miss: \
_Py_CODEUNIT *counter = (_Py_CODEUNIT *)next_instr; \
*counter -= 1; \
if (*counter == 0) { \
next_instr[-1] = _Py_MAKECODEUNIT(opname ## _ADAPTIVE, _Py_OPARG(next_instr[-1])); \
_Py_SET_OPCODE(next_instr[-1], opname ## _ADAPTIVE); \
STAT_INC(opname, deopt); \
*counter = ADAPTIVE_CACHE_BACKOFF; \
} \