1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00
serenity/Userland/Libraries/LibUnicode
Timothy Flynn 3fd53baa25 LibUnicode: Dynamically load the generated UnicodeData symbols
The generated data for libunicodedata.so is quite large, and loading it
is a price paid by nearly every application by way of depending on
LibRegex. In order to defer this cost until an application actually uses
one of the surrounding APIs, dynamically load the generated symbols.

To be able to load the symbols dynamically, the generated methods must
have demangled names. Typically, this is accomplished with `extern "C"`
blocks. The clang toolchain complains about this here because the types
returned from the generators are strictly C++ types. So to demangle the
names, we use the asm() compiler directive to manually define a symbol
name; the caveat is that we *must* be sure the symbols are unique. As an
extra precaution, we prefix each symbol name with "unicode_". For more
details, see: https://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html

This symbol loader used in this implementation provides the additional
benefit of removing many [[maybe_unused]] attributes from the LibUnicode
methods. Internally, if ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF, the
loader is able to stub out the function pointers it returns.

Note that as of this commit, LibUnicode is still directly linked against
LibUnicodeData. This commit is just a first step towards removing that.
2021-12-21 13:09:49 -08:00
..
CharacterTypes.cpp LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00
CharacterTypes.h LibUnicode: Support code point names that apply to ranges of code points 2021-11-30 11:24:02 +01:00
CMakeLists.txt LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00
CurrencyCode.cpp LibUnicode: Add some data related to currency codes 2021-09-11 11:05:50 +01:00
CurrencyCode.h LibUnicode: Add some data related to currency codes 2021-09-11 11:05:50 +01:00
DateTimeFormat.cpp LibUnicode: Parse and generate per-locale day period ranges 2021-12-10 21:27:24 +00:00
DateTimeFormat.h LibUnicode: Generate CalendarSymbols in a predetermined order 2021-12-13 21:28:56 -08:00
Forward.h LibUnicode: Add missing forward declarations to forwarding header 2021-12-21 13:09:49 -08:00
Locale.cpp LibUnicode: Add special handling of hour cycle (hc) Unicode keywords 2021-11-29 22:48:46 +00:00
Locale.h LibUnicode: Remove declaration of function which moved to another header 2021-12-21 13:09:49 -08:00
NumberFormat.cpp LibJS+LibUnicode: Generate unique numeric symbol lists 2021-12-11 14:17:47 +00:00
NumberFormat.h LibJS+LibUnicode: Generate unique numeric symbol lists 2021-12-11 14:17:47 +00:00
UnicodeSymbols.cpp LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00
UnicodeSymbols.h LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00