Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-115999: Refactor LOAD_GLOBAL specializations to avoid reloading {globals, builtins} keys #124953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mpage
Copy link
Contributor

@mpage mpage commented Oct 3, 2024

Each of the LOAD_GLOBAL specializations is implemented roughly as:

  1. Load keys version.
  2. Load cached keys version.
  3. Deopt if (1) and (2) don't match.
  4. Load keys.
  5. Load cached index into keys.
  6. Load object from (4) at offset from (5).

This is not thread-safe in free-threaded builds; the keys object may be replaced in between steps (3) and (4).

This change refactors the specializations to avoid reloading the keys object and instead pass the keys object from guards to be consumed by downstream uops.

…uiltins} keys

Each of the `LOAD_GLOBAL` specializations is implemented roughly as:

1. Load keys version.
2. Load cached keys version.
3. Deopt if (1) and (2) don't match.
4. Load keys.
5. Load cached index into keys.
6. Load object from (4) at offset from (5).

This is not thread-safe in free-threaded builds; the keys object may be replaced
in between steps (3) and (4).

This change refactors the specializations to avoid reloading the keys object and
instead pass the keys object from guards to be consumed by downstream uops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant