Files
RustPython/tools/opcode_metadata/cpython.py
T
dot a974ec938d Align compiler and VM with pinned CPython 3.15 ABI
Couple opcode/cache/stack metadata with iterator pairs, generator preambles, ordinary import packing, common constants, compiler lowering and VM/JIT consumers. Pin official source/tool hashes and retain strict raw code and marshal comparisons.

Use private development magic 0xDA16 and cache tag devabi2 until serialization and Python integration are coherent. Final clean corpus matches recursive code fields in 111/111 requests; full marshal/header exactness remains 0/111. Eight existing disassembly tests remain blocked by unchanged Lib metadata. Monitoring export and frozendict/update_lib integration remain explicit follow-on gates.

Validation: compiler-core 23, codegen 807, CAPI 121 (4 existing ignored), focused certified-controller pytest, release/frozen witnesses, workspace and CAPI all-target Clippy. Independent source/artifact review covers manifest ec1013591ae97b4c519f4a2c78a8200664f3479f0c5452991b5fea4d1be669ea.

Assisted-by: OpenAI Codex:model identifier unavailable
2026-10-12 00:20:11 +09:00

39 lines
1001 B
Python

import os
import pathlib
import sys
from functools import cache
from target_source import verify_import_origins, verify_source
try:
CPYTHON_ROOT = pathlib.Path(os.environ["CPYTHON_ROOT"]).expanduser().resolve()
except KeyError:
raise ValueError("Missing environment variable 'CPYTHON_ROOT'")
sys.dont_write_bytecode = True
verify_source(CPYTHON_ROOT)
verify_import_origins(CPYTHON_ROOT)
CPYTHON_TOOLS_LIB = CPYTHON_ROOT / "Tools" / "cases_generator"
if (path := CPYTHON_TOOLS_LIB.as_posix()) not in sys.path:
sys.path.insert(0, path)
from analyzer import SKIP_PROPERTIES, Analysis, Family, Properties, analyze_files
from stack import get_stack_effect
verify_import_origins(CPYTHON_ROOT)
@cache
def get_analysis() -> Analysis:
from generators_common import DEFAULT_INPUT
verify_import_origins(CPYTHON_ROOT)
analysis = analyze_files([DEFAULT_INPUT])
# Our speration is done at the enum definition
analysis.instructions |= analysis.pseudos
return analysis