ladybird/Libraries/LibWeb/Bindings
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
..
AgentType.h LibWeb: Move AgentType enum to its own header 2025-05-18 17:50:05 -06:00
AudioConstructor.cpp AK+Everywhere: Rename verify_cast to as 2025-01-21 11:34:06 -05:00
AudioConstructor.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ExceptionOrUtils.h LibWeb: Remove dom_ from dom_exception_to_throw_completion 2024-12-09 20:02:51 -07:00
HostDefined.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
HostDefined.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ImageConstructor.cpp LibJS: Inline the fast path of Value::to_i32() and simplify to_u32() 2025-04-09 22:06:49 +02:00
ImageConstructor.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Intrinsics.cpp LibWeb: Use enum for serialization and reimplement interface exposure 2025-07-15 09:20:02 -04:00
Intrinsics.h LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
MainThreadVM.cpp LibWeb: Implement resizable ArrayBuffers for Wasm memories 2025-08-23 08:26:23 +02:00
MainThreadVM.h LibWeb: Enable EXPLICIT_SYMBOL_EXPORT 2025-08-23 16:04:36 -06:00
OptionConstructor.cpp LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16 2025-07-24 19:00:20 +02:00
OptionConstructor.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
PlatformObject.cpp LibJS: Add inline caching for adding new own properties to objects 2025-09-17 12:44:44 +02:00
PlatformObject.h LibJS: Fast-path own-property enumeration and reduce descriptor lookups 2025-09-21 15:06:32 +02:00
PrincipalHostDefined.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
PrincipalHostDefined.h LibJS+LibWeb: Add fast_is<T> helpers for Realm::HostDefined class family 2025-04-18 14:45:56 +02:00
Serializable.h LibWeb+WebWorker: Use IPC mechanics for structured serialization 2025-07-18 10:09:02 -04:00
SyntheticHostDefined.cpp LibWeb: Visit proper base class in SyntheticHostDefined 2024-11-30 11:55:11 +01:00
SyntheticHostDefined.h LibJS+LibWeb: Add fast_is<T> helpers for Realm::HostDefined class family 2025-04-18 14:45:56 +02:00
Transferable.h LibWeb+WebWorker: Use IPC mechanics for structured serialization 2025-07-18 10:09:02 -04:00