Skip to content

gh-155962: Specialize LOAD_ATTR after replacing an instance's __dict__ - #155963

Open
koxudaxi wants to merge 2 commits into
python:mainfrom
koxudaxi:gh-155962-load-attr-replaced-dict
Open

gh-155962: Specialize LOAD_ATTR after replacing an instance's __dict__#155963
koxudaxi wants to merge 2 commits into
python:mainfrom
koxudaxi:gh-155962-load-attr-replaced-dict

Conversation

@koxudaxi

Copy link
Copy Markdown
Contributor

Fixes #155962.

instance_has_key() used shared keys whenever the type supported inline values, even if replacing an instance's __dict__ had invalidated its inline values.
Check the per-instance state and use the managed dictionary instead, allowing LOAD_ATTR_WITH_HINT specialization for replacement dictionaries.

Reject general-key dictionaries, which are unsupported by the hint opcodes, and add regression tests for stale shared keys and concurrent dictionary replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LOAD_ATTR does not specialize after replacing an instance's __dict__

1 participant