Repository navigation
[pull] main from oven-sh:main - #5
Merged
Merged
Conversation
Switch the Linux glibc and musl LTO lanes (and the local build.ts /
Dockerfile defaults) from -flto=full to -flto=thin -fno-split-lto-unit,
matching the macOS and Windows lanes.
Under ThinLTO the JIT was miscompiled: JSC identifies types by comparing
ClassInfo (s_info) pointers, but a set of "boilerplate" builtins define
byte-identical s_info initializers ({ "Function"_s, &Base::s_info,
nullptr, nullptr, CREATE_METHOD_TABLE(X) }) whose defining TU never takes
the address, so clang emits them as local_unnamed_addr. With safe ICF at
link time those objects folded together (21 s_info collapsed onto 4
addresses, notably JSStrictFunction/JSSloppyFunction/JSArrowFunction with
BooleanConstructor), so the DFG treated ordinary function calls as calls to
the Boolean constructor and inlined them as Boolean(arg).
Add CLASSINFO_KEEP_ADDRESS_UNIQUE(Class), which references Class::info()
from a `used` no-op function via an asm operand, marking each s_info address
as significant so the optimizer can no longer treat it as mergeable. Apply
it to the 21 affected always-live builtins. The keeper functions are
removed by --gc-sections, so there is no size or runtime cost.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by cubic
Switches builds to ThinLTO and prevents
ClassInfoaddress merging to fix a JSC JIT miscompile. Aligns Linux CI and local build defaults with ThinLTO for consistent builds.CLASSINFO_KEEP_ADDRESS_UNIQUE(Class)inClassInfo.hand applied it to affected builtins sos_infoaddresses remain distinct and aren’t merged under ThinLTO.-flto=thin -fno-split-lto-unitin.github/workflows/build-reusable.yml,Dockerfile,Dockerfile.musl, andbuild.tsto avoid miscompiles and match other platforms.Written for commit a36c188. Summary will update on new commits.