1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:57:35 +00:00
serenity/Userland/Libraries/LibWeb
davidot e746360b9a LibJS: Use NaN boxing to decrease the memory size of Values
Using the fact that there are 2^52-2 NaN representations we can
"NaN-box" all the Values possible. This means that Value no longer has
an explicit "Type" but that information is now stored in the bits of a
double. This is done by "tagging" the top two bytes of the double.
For a full explanation see the large comment with asserts at the top of
Value.

We can also use the exact representation of the tags to make checking
properties like nullish, or is_cell quicker. But the largest gains are
in the fact that the size of a Value is now halved.

The SunSpider and other benchmarks have been ran to confirm that there
are no regressions in performance compared to the previous
implementation. The tests never performed worse and in some cases
performed better. But the biggest differences can be seen in memory
usage when large arrays are allocated. A simple test which allocates a
1000 arrays of size 100000 has roughly half the memory usage.

There is also space in the representations for future expansions such as
tuples and records.

To ensure that Values on the stack and registers are not lost during
garbage collection we also have to add a check to the Heap to check for
any of the cell tags and extracting the canonical form of the pointer
if it matches.
2022-08-15 17:11:25 +02:00
..
Bindings LibJS: Use NaN boxing to decrease the memory size of Values 2022-08-15 17:11:25 +02:00
Cookie Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Crypto LibWeb: Let get_buffer_source_copy() return ErrorOr instead of Optional 2022-07-22 23:08:28 +01:00
CSS LibWeb: Follow image-rendering when painting image style values 2022-08-10 19:39:07 +02:00
DOM LibJS+LibWeb: Restore type safety of Realm::set_global_object() 2022-08-06 12:02:48 +02:00
DOMParsing AK: Use an enum instead of a bool for String::replace(all_occurences) 2022-07-06 11:12:45 +02:00
Encoding LibWeb: Let get_buffer_source_copy() return ErrorOr instead of Optional 2022-07-22 23:08:28 +01:00
Fetch LibWeb: Move extract_mime_type() from XMLHttpRequest to HeaderList 2022-07-20 18:03:21 +01:00
FileAPI LibWeb: Declare variable with the auto keyword 2022-08-02 08:20:40 +01:00
Geometry LibWeb: Add barebones implementation of DOMPoint and DOMPointReadOnly 2022-07-12 23:12:11 +02:00
HighResolutionTime Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
HTML LibWeb: Add fixmes for other missing CRC2D mixins 2022-08-14 11:30:40 +02:00
Infra LibWeb: Add 'byte-{lower,upper}case' operations from the Infra spec 2022-07-14 00:42:26 +01:00
IntersectionObserver LibWeb: Use the specification defined types in IntersectionObserverInit 2022-04-02 13:13:37 +03:00
Layout LibWeb: Remove unused member LineBuilder::m_layout_mode 2022-08-14 23:33:28 +02:00
Loader LibWeb: Start implementing "create and initialize a Document" from HTML 2022-08-05 12:46:40 +02:00
MimeSniff LibWeb: Move Fetch infra into the Web::Fetch::Infrastructure namespace 2022-07-19 00:27:35 +01:00
NavigationTiming LibWeb: Use long long where it was replaced with long 2022-06-06 22:34:45 +01:00
Page LibWeb: Bring browsing context creation closer to spec 2022-08-05 12:46:42 +02:00
Painting LibWeb: Implement linear-gradient() transition hints 2022-08-12 12:24:15 +02:00
RequestIdleCallback LibWeb: Implement the infrastructure necessary for requestIdleCallback 2022-04-02 23:52:25 +01:00
ResizeObserver LibWeb: Add the ResizeObserverBoxOptions IDL enum 2022-04-02 13:13:37 +03:00
Scripts
Selection LibWeb: Add imports to all IDL files that depend on others 2022-02-16 22:48:32 +03:30
SVG LibWeb: Stub out two functions on SVGGeometryElement 2022-07-12 23:12:11 +02:00
Tests LibWeb: Capture <script> element's node document on execution 2021-12-21 13:50:00 -08:00
UIEvents LibWeb: Dispatch dblclick UI Events on double click 2022-06-20 12:55:50 +01:00
URL LibWeb: Mark URLSearchParams::to_string() as const 2022-07-18 14:57:58 +01:00
WebAssembly Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
WebGL LibWeb: Use "unrestricted float/double" where we should in IDL 2022-08-14 11:30:40 +02:00
WebSockets LibWeb: Move Origin into the HTML namespace 2022-07-14 00:42:26 +01:00
XHR LibWeb: Add public get accessor function for Blob's internal ByteBuffer 2022-07-26 20:54:30 +01:00
XML Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CMakeLists.txt LibWeb: Extract CanvasDrawImage class from CRC2D 2022-08-14 11:30:40 +02:00
Dump.cpp LibWeb: Show iframe URLs in layout tree dumps 2022-08-05 12:46:40 +02:00
Dump.h LibWeb: Implement initial CSSFontFaceRule and FontFace classes 2022-03-28 22:25:25 +02:00
FontCache.cpp LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
FontCache.h LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Forward.h LibWeb: Extract CanvasDrawPath class from CRC2D 2022-08-14 11:30:40 +02:00
idl_files.cmake LibWeb: Implement Path2D class 2022-08-14 11:30:40 +02:00
ImageDecoding.cpp LibWeb: Abstract the image decoding via Web::ImageDecoding::Decoder 2022-05-15 12:17:36 +02:00
ImageDecoding.h LibWeb: Abstract the image decoding via Web::ImageDecoding::Decoder 2022-05-15 12:17:36 +02:00
Namespace.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Namespace.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TreeNode.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00