ladybird/Userland/Libraries/LibWeb/Bindings
Anonymous 745b998774 LibJS: Get rid of unnecessary work from canonical_numeric_index_string
The spec version of canonical_numeric_index_string is absurdly complex,
and ends up converting from a string to a number, and then back again
which is both slow and also requires a few allocations and a string
compare.

Instead this patch moves away from using Values to represent canonical
a canonical index. In most cases all we need to know is whether a
PropertyKey is an integer between 0 and 2^^32-2, which we already
compute when we construct a PropertyKey so the existing is_number()
check is sufficient.

The more expensive case is handling strings containing numbers that
don't roundtrip through string conversion. In most cases these turn
into regular string properties, but for TypedArray access these
property names are not treated as normal named properties.
TypedArrays treat these numeric properties as magic indexes that are
ignored on read and are not stored (but are evaluated) on assignment.

For that reason there's now a mode flag on canonical_numeric_index_string
so that only TypedArrays take the cost of the ToString round trip test.
In order to improve the performance of this path this patch includes
some early returns to avoid conversion in cases where we can quickly
know whether a property can round trip.
2022-02-14 21:06:49 +00:00
..
CallbackType.h LibWeb: Introduce the Environment Settings Object 2022-02-08 17:47:44 +00:00
CSSNamespace.cpp
CSSNamespace.h
CSSRuleWrapperFactory.cpp
CSSRuleWrapperFactory.h
CSSStyleDeclarationWrapperCustom.cpp
EventListenerWrapper.cpp
EventListenerWrapper.h
EventTargetWrapperFactory.cpp
EventTargetWrapperFactory.h
EventWrapperFactory.cpp
EventWrapperFactory.h
ExceptionOrUtils.h
IDLAbstractOperations.cpp LibJS: Get rid of unnecessary work from canonical_numeric_index_string 2022-02-14 21:06:49 +00:00
IDLAbstractOperations.h LibJS: Get rid of unnecessary work from canonical_numeric_index_string 2022-02-14 21:06:49 +00:00
ImageConstructor.cpp
ImageConstructor.h
LocationObject.cpp
LocationObject.h
MainThreadVM.cpp LibJS: Replace uses of MarkedValueList with MarkedVector<Value> 2022-02-09 12:25:27 +00:00
MainThreadVM.h LibWeb: Implement the JS host hooks for promises, job callbacks and more 2022-02-08 17:47:44 +00:00
NavigatorObject.cpp
NavigatorObject.h
NodeWrapperFactory.cpp LibWeb: Add SVG <polygon> element and test case :^) 2022-02-11 21:38:27 +01:00
NodeWrapperFactory.h
Replaceable.h
WindowObject.cpp LibWeb: Add Storage interface and window.localStorage 2022-02-08 21:53:20 +01:00
WindowObject.h LibWeb: Add Storage interface and window.localStorage 2022-02-08 21:53:20 +01:00
WindowObjectHelper.h LibWeb: Implement Geometry::DOMRectList 2022-02-12 22:43:10 +01:00
Wrappable.cpp
Wrappable.h
Wrapper.h LibJS: Remove the JS_TRACK_ZOMBIE_CELLS option 2022-02-05 11:52:51 +01:00