mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
bpo-43693: Compute deref offsets in compiler (gh-25152)
Merges locals and cells into a single array. Saves a pointer in the interpreter and means that we don't need the LOAD_CLOSURE opcode any more https://bugs.python.org/issue43693
This commit is contained in:
parent
35002aa8f6
commit
b2bf2bc1ec
11 changed files with 222 additions and 209 deletions
|
@ -378,14 +378,11 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
|
|||
elif op in hasjrel:
|
||||
argval = offset + 2 + arg*2
|
||||
argrepr = "to " + repr(argval)
|
||||
elif op in haslocal:
|
||||
elif op in haslocal or op in hasfree:
|
||||
argval, argrepr = _get_name_info(arg, varname_from_oparg)
|
||||
elif op in hascompare:
|
||||
argval = cmp_op[arg]
|
||||
argrepr = argval
|
||||
elif op in hasfree:
|
||||
argval, argrepr = _get_name_info(arg, varname_from_oparg,
|
||||
cell=True)
|
||||
elif op == FORMAT_VALUE:
|
||||
argval, argrepr = FORMAT_VALUE_CONVERTERS[arg & 0x3]
|
||||
argval = (argval, bool(arg & 0x4))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue