mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-19 05:29:46 +08:00
Worker runtime variants link only into executables, whose own TLS block holds every runtime thread-local, but they were compiled with the default general-dynamic model. The linker relaxes each __tls_get_addr call to a %fs-relative address, yet the compiler had already treated it as a call: hot runtime leaves saved and restored extra registers around every thread-local access (scr_mg_visit pushed five registers instead of one). With -ftls-model=initial-exec each access is one %fs-relative operand. Darwin, Windows and wasm variants are unchanged. tsc-ts self-check, Linux sandbox, Worker build vs non-worker build: 1.04x -> 1.03x (9 interleaved runs).