This commit changes `AK::TypeErasedParameter` to store integer, floating-point and string types as well as characters and booleans directly instead of through a type-erased `void const*`. This is advantageous for binary size: - The compiler no longer needs to push both the parameter value and a pointer to it to the stack (which contains the argument array); storing just the value is enough. - Instead of instantiating `__format_value` for these types and taking its address (which generates a GOT entry and an ADRP+LDR pair in assembly), we just store a constant `TypeErasedParameter::Type` value. - The biggest saving comes from the fact that we used to instantiate a distinct `__format_value` for each length of string literal. For LibJS, this meant 69 different functions! We can now just store them as a `char const*`. I opted to use a manual tagged union instead of `Variant`: the code wouldn't be much shorter if we used a `Variant` since we'd have to handle converting the standard integer types to `u64`/`i64` and custom types to the type erased wrapper via explicit constructors anyway. And compile time overhead is smaller this way. This gives us some nice binary size savings (numbers are from arm64 macOS LibJS): FILE SIZE VM SIZE -------------- -------------- +52% +10.3Ki +52% +10.3Ki [__TEXT] +5.2% +768 +5.2% +768 [__DATA_CONST] -0.0% -7 -0.0% -7 __TEXT,__cstring -3.0% -144 -3.0% -144 __TEXT,__stubs -1.2% -176 -1.2% -176 Function Start Addresses -11.6% -432 -11.6% -432 Indirect Symbol Table -1.0% -448 -1.0% -448 Code Signature -18.1% -768 -18.1% -768 __DATA_CONST,__got -0.8% -6.83Ki -0.8% -6.83Ki Symbol Table -1.0% -11.2Ki -1.0% -11.2Ki String Table -0.9% -26.1Ki -0.9% -26.1Ki __TEXT,__text -7.2% -20.9Ki -9.6% -28.9Ki [__LINKEDIT] -1.0% -56.0Ki -1.1% -64.0Ki TOTAL |
||
---|---|---|
.devcontainer | ||
.github | ||
AK | ||
Base/res | ||
Documentation | ||
Libraries | ||
Meta | ||
Services | ||
Tests | ||
Toolchain | ||
UI | ||
Utilities | ||
.clang-format | ||
.clang-tidy | ||
.clangd | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gn | ||
.mailmap | ||
.pre-commit-config.yaml | ||
.prettierignore | ||
.prettierrc | ||
.swift-format | ||
.ycm_extra_conf.py | ||
CMakeLists.txt | ||
CMakePresets.json | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
ISSUES.md | ||
LICENSE | ||
pyproject.toml | ||
README.md | ||
SECURITY.md | ||
vcpkg-configuration.json | ||
vcpkg.json |
Ladybird
Ladybird is a truly independent web browser, using a novel engine based on web standards.
Important
Ladybird is in a pre-alpha state, and only suitable for use by developers
Features
We aim to build a complete, usable browser for the modern web.
Ladybird uses a multi-process architecture with a main UI process, several WebContent renderer processes, an ImageDecoder process, and a RequestServer process.
Image decoding and network connections are done out of process to be more robust against malicious content. Each tab has its own renderer process, which is sandboxed from the rest of the system.
At the moment, many core library support components are inherited from SerenityOS:
- LibWeb: Web rendering engine
- LibJS: JavaScript engine
- LibWasm: WebAssembly implementation
- LibCrypto/LibTLS: Cryptography primitives and Transport Layer Security
- LibHTTP: HTTP/1.1 client
- LibGfx: 2D Graphics Library, Image Decoding and Rendering
- LibUnicode: Unicode and locale support
- LibMedia: Audio and video playback
- LibCore: Event loop, OS abstraction layer
- LibIPC: Inter-process communication
How do I build and run this?
See build instructions for information on how to build Ladybird.
Ladybird runs on Linux, macOS, Windows (with WSL2), and many other *Nixes.
How do I read the documentation?
Code-related documentation can be found in the documentation folder.
Get in touch and participate!
Join our Discord server to participate in development discussion.
Please read Getting started contributing if you plan to contribute to Ladybird for the first time.
Before opening an issue, please see the issue policy and the detailed issue-reporting guidelines.
The full contribution guidelines can be found in CONTRIBUTING.md
.
License
Ladybird is licensed under a 2-clause BSD license.