Content-Length: 267885 | pFad | https://github.com/python/cpython/issues/128685

ad `LOAD_CONST_IMMORTAL` doesn't survive being instrumented and de-instrumented. · Issue #128685 · python/cpython · GitHub
Skip to content

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

Description

@markshannon

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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/128685

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy