◐ Shell
clean mode source ↗

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

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