Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Replace KW_NAMES with LOAD_CONST/PUSH_NULL
  • Loading branch information
brandtbucher committed Jun 11, 2023
commit 28adc9087e963f4b74410d4a8af83d0423358c3f
9 changes: 0 additions & 9 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1370,15 +1370,6 @@ iterations of the loop.
.. versionadded:: 3.11


.. opcode:: KW_NAMES (consti)

Prefixes :opcode:`CALL`.
Stores a reference to ``co_consts[consti]`` into an internal variable
for use by :opcode:`CALL`. ``co_consts[consti]`` must be a tuple of strings.

.. versionadded:: 3.11


.. opcode:: MAKE_FUNCTION (flags)

Pushes a new function object on the stack. From bottom to top, the consumed
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode.h

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

2 changes: 0 additions & 2 deletions Include/opcode.h

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

3 changes: 1 addition & 2 deletions Lib/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ def pseudo_op(name, op, real_ops):
def_op('STORE_FAST_LOAD_FAST', 169)
def_op('STORE_FAST_STORE_FAST', 170)
def_op('CALL', 171)
def_op('KW_NAMES', 172)
hasconst.append(172)

def_op('CALL_INTRINSIC_1', 173)
def_op('CALL_INTRINSIC_2', 174)

Expand Down
1 change: 1 addition & 0 deletions Lib/test/test_compiler_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_for_loop(self):
('PUSH_NULL', None, 2),
('LOAD_NAME', 2, 2),
('LOAD_NAME', 1, 2),
('PUSH_NULL', None, 2),
('CALL', 1, 2),
('POP_TOP', None),
('JUMP', loop_lbl),
Expand Down
300 changes: 165 additions & 135 deletions Lib/test/test_dis.py

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions Lib/test/test_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,12 @@ def func2():
('instruction', 'func2', 8),
('instruction', 'func2', 28),
('instruction', 'func2', 30),
('instruction', 'func2', 38),
('line', 'func2', 3),
('instruction', 'func2', 32),
('instruction', 'func2', 40),
('line', 'func2', 3),
('instruction', 'func2', 42),
('instruction', 'func2', 44),
('instruction', 'func2', 46),
('line', 'check_events', 11)])

def test_try_except(self):
Expand Down Expand Up @@ -1158,8 +1159,8 @@ def func():
('line', 'func', 5),
('line', 'meth', 1),
('jump', 'func', 5, 5),
('jump', 'func', 5, '[offset=112]'),
('branch', 'func', '[offset=118]', '[offset=120]'),
('jump', 'func', 5, '[offset=116]'),
('branch', 'func', '[offset=122]', '[offset=124]'),
('line', 'check_events', 11)])

self.check_events(func, recorders = FLOW_AND_LINE_RECORDERS, expected = [
Expand All @@ -1174,8 +1175,8 @@ def func():
('line', 'meth', 1),
('return', None),
('jump', 'func', 5, 5),
('jump', 'func', 5, '[offset=112]'),
('branch', 'func', '[offset=118]', '[offset=120]'),
('jump', 'func', 5, '[offset=116]'),
('branch', 'func', '[offset=122]', '[offset=124]'),
('return', None),
('line', 'check_events', 11)])

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ class C(object): pass
def func():
return sys._getframe()
x = func()
check(x, size('3Pi3c7P2ic??2P'))
check(x, size('3Pi3c7P2ic??3P'))
# function
def func(): pass
check(func, size('15Pi'))
Expand Down
2 changes: 1 addition & 1 deletion Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ mark_stacks(PyCodeObject *code_obj, int len)
case CALL:
{
int args = oparg;
for (int j = 0; j < args+2; j++) {
for (int j = 0; j < args+3; j++) {
next_stack = pop_value(next_stack);
}
next_stack = push_value(next_stack, Object);
Expand Down
66 changes: 33 additions & 33 deletions Programs/test_frozenmain.h

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

Loading