Skip to content
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

LOAD_CONST_IMMORTAL doesn't survive being instrumented and de-instrumented. #128685

Open
markshannon opened this issue Jan 9, 2025 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@markshannon
Copy link
Member

markshannon commented Jan 9, 2025

Bug report

Bug description:

When instrumenting, instructions are first de-optimized to their base instruction.
When instrumentation is removed we assume that specialization will restore the specialized instruction.
However, that doesn't happen for LOAD_CONST_IMMORTAL because LOAD_CONST_IMMORTAL isn't a specialization form of LOAD_CONST, but a quickened form of it.

The fix should be simple. Instead of quickening LOAD_CONST to LOAD_CONST_IMMORTAL, we add a LOAD_CONST_MORTAL and have LOAD_CONST specialize (rather than quicken) to either LOAD_CONST_MORTAL or LOAD_CONST_IMMORTAL.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

@markshannon markshannon added the type-bug An unexpected behavior, bug, or error label Jan 9, 2025
@markshannon markshannon changed the title LOAD_CONST_IMMORTAL doesn't survive being instrumented and de-instruemented. LOAD_CONST_IMMORTAL doesn't survive being instrumented and de-instrumented. Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant