Skip to content

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

@cocolato

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

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