Skip to content

Conversation

@Maqrkk
Copy link
Member

@Maqrkk Maqrkk commented Oct 15, 2025

No description provided.

TypeOptimizer can now deal with rewriting an intrinsic of type threadlocal_address.
A valid guard is already passed for tls_init. Making guards per variable here would break thread locals, since the guards are global, and so are only executed once, instead of once per thread.
Previously I assumed all access to thread locals would use the threadlocal_address intrinsic. This turns out not to be true. Therefore we need to check every access to a global to see if it is a thread local, and calculate the address differently.
This was originally meant to be a threadlocal, but at the time threadlocals weren't supported.
This commit also reverts commit 29a1062.
@Maqrkk Maqrkk requested a review from yuri91 October 15, 2025 13:47
Copy link
Member

@yuri91 yuri91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
What is the story for asm.js? Do we support threads in general or not? if so, we should fix the compilation of thread local accesses as you did for wasm

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.

3 participants