Skip to content

Support track __slots__ object and its property in the Tier 2 optimizer #144145

Closed as duplicate

Description

@cocolato

Feature or enhancement

Proposal:

Currently, when the JIT optimizer encounters _LOAD_ATTR_SLOT, it creates a new unknown symbol (<!NULL>) even if the same slot was previously written in the same trace. This prevents the optimizer from:

  1. Knowing the type of values loaded from slots
  2. Eliminating redundant type guards
  3. Performing further type-based optimizations

To achieve these optimizations, we need:

  1. keep track of where code might escape
  2. implement tracking and optimization for attributes of the __slots__ object

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. Kaushalt2004 commented on Jan 22, 2026

    @Kaushalt2004
    Contributor

    i will try to review this

  2. added a commit that references this issue on Jan 30, 2026
  3. Fidget-Spinner commented on Jan 30, 2026

    @Fidget-Spinner
    Member

    For future work on STORE_ATTR_HINT, please link it to #144141

  4. added a commit that references this issue on Feb 2, 2026
  5. added a commit that references this issue on Feb 2, 2026
  6. added a commit that references this issue on Feb 3, 2026
  7. added 2 commits that reference this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-JITtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions