gh-105481: remove regen-opcode. Generated _PyOpcode_Caches in regen-cases. (#108367)

This commit is contained in:
Irit Katriel 2023-08-23 18:39:00 +01:00 committed by GitHub
parent 422f81b5d2
commit 72119d16a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 78 additions and 176 deletions

View file

@ -540,6 +540,18 @@ class Generator(Analyzer):
for name in self.opmap:
self.out.emit(f'[{name}] = "{name}",')
with self.metadata_item(
f"const uint8_t _PyOpcode_Caches[256]",
"=",
";",
):
for name, _ in self.families.items():
instr = self.instrs[name]
if instr.cache_offset > 0:
self.out.emit(f'[{name}] = {instr.cache_offset},')
# Irregular case:
self.out.emit('[JUMP_BACKWARD] = 1,')
deoptcodes = {}
for name, op in self.opmap.items():
if op < 256: