10000 gh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis by iritkatriel · Pull Request #112377 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis #112377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

iritkatriel
Copy link
Member
@iritkatriel iritkatriel commented Nov 24, 2023

With this ./python.exe -Xuops -m test -v test_dis passes.

@iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Nov 24, 2023
@@ -373,6 +374,8 @@ def _get_argval_argrepr(op, arg, offset, co_consts, names, varname_from_oparg,
argval = offset + 2 + signed_arg*2
caches = _get_cache_size(_all_opname[deop])
argval += 2 * caches
if deop == ENTER_EXECUTOR:
argval += 2
Copy link
Member Author
@iritkatriel iritkatriel Nov 24, 2023

Choose a reason for hiding this comment

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

It would be nice if we didn't need to special case this here, but that would require a change in the oparg (and implementation) of ENTER_EXECUTOR, and I figured this PR should just fix the bug in dis.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, this must be the cache of the underlying JUMP_BACKWARD. I think there currently is no way to get that. Not even via _testinternalcapi.

we should file an issue about that, it will get worse once we start putting executors on other ops.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created an issue here: #112383

Copy link
Member
@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -373,6 +374,8 @@ def _get_argval_argrepr(op, arg, offset, co_consts, names, varname_from_oparg,
argval = offset + 2 + signed_arg*2
caches = _get_cache_size(_all_opname[deop])
argval += 2 * caches
if deop == ENTER_EXECUTOR:
argval += 2
Copy link
Member

Choose a reason for hiding this comment

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

Oh, this must be the cache of the underlying JUMP_BACKWARD. I think there currently is no way to get that. Not even via _testinternalcapi.

we should file an issue about that, it will get worse once we start putting executors on other ops.

@iritkatriel iritkatriel merged commit 9eb3b35 into python:main Nov 24, 2023
@iritkatriel iritkatriel deleted the dis-ENTER_EXECUTOR branch November 28, 2023 12:45
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0