ladybird/Meta/Lagom/Tools/CodeGenerators/LibWeb
Aliaksandr Kalenik 451c947c3f LibJS: Fast-path own-property enumeration and reduce descriptor lookups
Before this change, PropertyNameIterator (used by for..in) and
`Object::enumerable_own_property_names()` (used by `Object.keys()`,
`Object.values()`, and `Object.entries()`) enumerated an object's own
enumerable properties exactly as the spec prescribes:
- Call `internal_own_property_keys()`, allocating a list of JS::Value
  keys.
- For each key, call internal_get_own_property() to obtain a
  descriptor and check `[[Enumerable]]`.

While that is required in the general case (e.g. for Proxy objects or
platform/exotic objects that override `[[OwnPropertyKeys]]`), it's
overkill for ordinary JS objects that store their own properties in the
shape table and indexed-properties storage.

This change introduces `for_each_own_property_with_enumerability()`,
which, for objects where
`eligible_for_own_property_enumeration_fast_path()` is `true`, lets us
read the enumerability directly from shape metadata (and from
indexed-properties storage) without a per-property descriptor lookup.
When we cannot avoid `internal_get_own_property()`, we still
benefit by skipping the temporary `Vector<Value>` of keys and avoiding
the unnecessary round-trip between PropertyKey and Value.
2025-09-21 15:06:32 +02:00
..
BindingsGenerator LibJS: Fast-path own-property enumeration and reduce descriptor lookups 2025-09-21 15:06:32 +02:00
CMakeLists.txt LibWeb: Generate the "Numeric Factory" OM methods on the CSS namespace 2025-09-11 17:06:44 +01:00
GenerateAriaRoles.cpp Everywhere: Rename serenity_main to ladybird_main 2025-07-08 09:17:16 -04:00
GenerateCSSDescriptors.cpp LibWeb: Move and rename CSSStyleValue to StyleValues/StyleValue.{h,cpp} 2025-08-08 15:19:03 +01:00
GenerateCSSEnums.cpp Everywhere: Rename serenity_main to ladybird_main 2025-07-08 09:17:16 -04:00
GenerateCSSEnvironmentVariable.cpp LibWeb+CodeGenerators: Generate EnvironmentVariable enum and functions 2025-08-07 16:38:29 +02:00
GenerateCSSKeyword.cpp LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
GenerateCSSMathFunctions.cpp LibWeb: Generate a math_function_from_string() function 2025-08-29 11:57:10 +02:00
GenerateCSSMediaFeatureID.cpp Everywhere: Rename serenity_main to ladybird_main 2025-07-08 09:17:16 -04:00
GenerateCSSNumericFactoryMethods.cpp LibWeb: Generate the "Numeric Factory" OM methods on the CSS namespace 2025-09-11 17:06:44 +01:00
GenerateCSSPropertyID.cpp LibWeb: Add the overflow-inline property 2025-09-19 13:41:27 +01:00
GenerateCSSPseudoClass.cpp LibWeb/CSS: Remove unused <an+b># code for pseudo-classes 2025-08-28 12:40:03 +02:00
GenerateCSSPseudoElement.cpp LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
GenerateCSSStyleProperties.cpp Everywhere: Rename serenity_main to ladybird_main 2025-07-08 09:17:16 -04:00
GenerateCSSTransformFunctions.cpp Everywhere: Rename serenity_main to ladybird_main 2025-07-08 09:17:16 -04:00
GenerateCSSUnits.cpp LibWeb/CSS: Generate canonical/compatible unit functions 2025-09-12 13:45:41 +02:00
GenerateNamedCharacterReferences.cpp AK: Store hash with HashTable entry to avoid expensive equality checks 2025-09-18 22:37:18 +02:00
GenerateWindowOrWorkerInterfaces.cpp LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
GeneratorUtil.h CodeGenerators: Move some utilities out of GenerateCSSStyleProperties 2025-03-27 11:53:09 +00:00