1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00
serenity/Userland/Libraries/LibWeb/Bindings
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
..
AudioConstructor.cpp LibWeb: Use correct global object in legacy factories 2022-04-04 14:22:16 +01:00
AudioConstructor.h DevTools+LibJS+LibWeb: Change class_name to use StringView 2022-03-19 00:20:46 +00:00
CallbackType.h LibWeb: Introduce the Environment Settings Object 2022-02-08 17:47:44 +00:00
CrossOriginAbstractOperations.cpp LibWeb: Implement 'cross-origin accessible window property name' concept 2022-03-08 23:13:54 +01:00
CrossOriginAbstractOperations.h LibWeb: Implement 'cross-origin accessible window property name' concept 2022-03-08 23:13:54 +01:00
CSSNamespace.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
CSSNamespace.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
CSSRuleWrapperFactory.cpp LibWeb: Add CSSSupportsRule wrapper 2022-05-11 20:16:10 +02:00
CSSRuleWrapperFactory.h LibWeb: Add the CSSStyleRule interface with some limited functionality 2021-09-30 00:00:55 +02:00
CSSStyleDeclarationWrapperCustom.cpp LibWeb: Support CSSStyleDeclaration.cssFloat 2022-02-21 22:27:56 +01:00
EventListenerWrapper.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
EventListenerWrapper.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
EventTargetWrapperFactory.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
EventTargetWrapperFactory.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
EventWrapperFactory.cpp LibWeb: Introduce the WebGL namespace and add WebGLContextEvent 2022-06-13 21:45:27 +01:00
EventWrapperFactory.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ExceptionOrUtils.h LibWeb: Allow returning JS::ThrowCompletionOr<T> from wrapped functions 2022-03-09 16:43:00 +01:00
IDLAbstractOperations.cpp LibJS: Use NaN boxing to decrease the memory size of Values 2022-08-15 17:11:25 +02:00
IDLAbstractOperations.h LibWeb: Let get_buffer_source_copy() return ErrorOr instead of Optional 2022-07-22 23:08:28 +01:00
ImageConstructor.cpp LibWeb: Use correct global object in legacy factories 2022-04-04 14:22:16 +01:00
ImageConstructor.h DevTools+LibJS+LibWeb: Change class_name to use StringView 2022-03-19 00:20:46 +00:00
LocationConstructor.cpp LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
LocationConstructor.h LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
LocationObject.cpp LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
LocationObject.h Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
LocationPrototype.h LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
MainThreadVM.cpp LibJS+LibWeb: Restore type safety of Realm::set_global_object() 2022-08-06 12:02:48 +02:00
MainThreadVM.h LibJS+LibWeb: Restore type safety of Realm::set_global_object() 2022-08-06 12:02:48 +02:00
NavigatorConstructor.cpp LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
NavigatorConstructor.h LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
NavigatorObject.cpp LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
NavigatorObject.h LibWeb: Support navigator.javaEnabled() (always false) 2022-03-26 17:31:01 +01:00
NavigatorPrototype.h LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
NodeWrapperFactory.cpp LibWeb: Wrap DOM::Attribute in NodeWrapperFactory 2022-07-11 22:35:08 +02:00
NodeWrapperFactory.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
OptionConstructor.cpp LibWeb: Add legacy Option factory function 2022-04-04 13:53:26 +01:00
OptionConstructor.h LibWeb: Add legacy Option factory function 2022-04-04 13:53:26 +01:00
Replaceable.h LibWeb: Convert the Window object to ThrowCompletionOr 2021-10-31 15:48:36 +01:00
WindowConstructor.cpp LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
WindowConstructor.h LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
WindowObject.cpp LibWeb: Support assigning to window.location 2022-08-05 12:46:42 +02:00
WindowObject.h LibWeb: Support assigning to window.location 2022-08-05 12:46:42 +02:00
WindowObjectHelper.h LibWeb: Implement Path2D class 2022-08-14 11:30:40 +02:00
WindowPrototype.h LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
WindowProxy.cpp LibWeb: Implement the WindowProxy exotic object 2022-03-08 23:13:54 +01:00
WindowProxy.h LibWeb: Implement the WindowProxy exotic object 2022-03-08 23:13:54 +01:00
Wrappable.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
Wrappable.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Wrapper.h LibJS: Remove the JS_TRACK_ZOMBIE_CELLS option 2022-02-05 11:52:51 +01:00