◐ Shell
clean mode source ↗

gh-109256: allocate opcode IDs for internal opcodes in their own range by iritkatriel · Pull Request #109269 · python/cpython

@iritkatriel iritkatriel changed the title gh-09256: allocate opcode IDs for internal opcodes in their own range gh-109256: allocate opcode IDs for internal opcodes in their own range

Sep 11, 2023

markshannon

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, in general.

test_dis will need fixing up, of course.

As you need to fix test_dis anyway could you make RESUME opcode 1? If it is to have a special number, it might as well be memorable.

    map_op(1, "RESUME")
    next_opcode = 2

@iritkatriel

Looks good, in general.

test_dis will need fixing up, of course.

As you need to fix test_dis anyway could you make RESUME opcode 1? If it is to have a special number, it might as well be memorable.

    map_op(1, "RESUME")
    next_opcode = 2

RESUME has an arg though, so I thought it should be after HAVE_ARGUMENT? Unless we want to special case it.

markshannon

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Should save a fair bit of future churn.
Merge conflicts need fixing, obviously.

vstinner pushed a commit to vstinner/cpython that referenced this pull request

Sep 13, 2023