Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ the following command can be used to display the disassembly of
>>> dis.dis(myfunc)
2 0 RESUME 0
<BLANKLINE>
3 2 LOAD_GLOBAL 1 (NULL + len)
3 2 LOAD_GLOBAL 1 (len + NULL)
12 LOAD_FAST 0 (alist)
14 CALL 1
22 RETURN_VALUE
Expand Down
12 changes: 6 additions & 6 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Lib/dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,15 +552,15 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
if deop == LOAD_GLOBAL:
argval, argrepr = _get_name_info(arg//2, get_name)
if (arg & 1) and argrepr:
argrepr = "NULL + " + argrepr
argrepr = f"{argrepr} + NULL"
elif deop == LOAD_ATTR:
argval, argrepr = _get_name_info(arg//2, get_name)
if (arg & 1) and argrepr:
argrepr = "NULL|self + " + argrepr
argrepr = f"{argrepr} + NULL|self"
elif deop == LOAD_SUPER_ATTR:
argval, argrepr = _get_name_info(arg//4, get_name)
if (arg & 1) and argrepr:
argrepr = "NULL|self + " + argrepr
argrepr = f"{argrepr} + NULL|self"
else:
argval, argrepr = _get_name_info(arg, get_name)
elif deop in hasjabs:
Expand Down
3 changes: 2 additions & 1 deletion Lib/importlib/_bootstrap_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ def _write_atomic(path, data, mode=0o666):
# Python 3.13a1 3555 (generate specialized opcodes metadata from bytecodes.c)
# Python 3.13a1 3556 (Convert LOAD_CLOSURE to a pseudo-op)
# Python 3.13a1 3557 (Make the conversion to boolean in jumps explicit)
# Python 3.13a1 3558 (Reorder the stack items for CALL)

# Python 3.14 will start with 3600

Expand All @@ -469,7 +470,7 @@ def _write_atomic(path, data, mode=0o666):
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.

MAGIC_NUMBER = (3557).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3558).to_bytes(2, 'little') + b'\r\n'

_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_compiler_assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ def inner():

instructions = [
('RESUME', 0,),
('PUSH_NULL', 0, 1),
('LOAD_CLOSURE', 0, 1),
('BUILD_TUPLE', 1, 1),
('LOAD_CONST', 1, 1),
('MAKE_FUNCTION', 0, 2),
('SET_FUNCTION_ATTRIBUTE', 8, 2),
('PUSH_NULL', 0, 1),
('CALL', 0, 2), # (lambda: x)()
('LOAD_CONST', 2, 2), # 2
('BINARY_OP', 6, 2), # %
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_compiler_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def test_for_loop(self):
loop_lbl := self.Label(),
('FOR_ITER', exit_lbl := self.Label(), 1),
('STORE_NAME', 1, 1),
('PUSH_NULL', None, 2),
('LOAD_NAME', 2, 2),
('PUSH_NULL', None, 2),
('LOAD_NAME', 1, 2),
('CALL', 1, 2),
('POP_TOP', None),
Expand Down
56 changes: 28 additions & 28 deletions Lib/test/test_dis.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Modify the bytecode so that the actual callable for a :opcode:`CALL` is at a
consistent position on the stack (regardless of whether or not
bound-method-calling optimizations are active).
2 changes: 1 addition & 1 deletion Objects/exception_handling_notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ a table to determine where to jump to when an exception is raised.

2 2 NOP

3 4 LOAD_GLOBAL 1 (NULL + g)
3 4 LOAD_GLOBAL 1 (g + NULL)
16 LOAD_CONST 1 (0)
18 PRECALL 1
22 CALL 1
Expand Down
22 changes: 11 additions & 11 deletions Programs/test_frozenmain.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading