ladybird/Libraries/LibJS/Tests/builtins
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
..
AggregateError
Array LibJS: Skip prototype chain lookup in internal_set() for arrays 2025-05-23 14:51:32 +02:00
ArrayBuffer
AsyncDisposableStack LibJS: Implement the AsyncDisposableStack interface 2025-01-17 20:46:32 +01:00
AsyncGenerator Everywhere: Fix typos - act III 2025-06-16 14:20:48 +01:00
Atomics
BigInt LibJS+LibCrypto: Use a bitwise approach for BigInt's as*IntN methods 2025-03-20 09:44:12 +01:00
Boolean
DataView
Date LibJS: Unit tests for non-standard date formats 2025-05-26 18:48:09 +02:00
DisposableStack
Error LibTest/Tests: Build and run test-js on windows 2025-06-05 22:00:55 -06:00
FinalizationRegistry
Function LibJS: Optimize Function.prototype.apply() 2025-06-03 17:16:01 +02:00
functions LibJS: Fix parseFloat(-0) returning -0 instead of +0 2025-03-02 11:30:34 -05:00
Infinity
Intl LibJS: Implement Intl.Locale.prototype.variants 2025-06-04 17:11:35 -04:00
Iterator LibJS: Ensure iterator parameter validation closes underlying iterator 2025-04-29 07:33:08 -04:00
JSON LibJS: Implement rawJSON and isRawJSON functions 2025-04-24 09:33:49 -04:00
Map
Math LibJS: Implement Math.sumPrecise 2025-03-03 21:46:22 +01:00
NaN
Number Meta+LibUnicode+LibJS: Upgrade to ICU 76.1 2025-01-18 17:56:40 -05:00
Object LibJS: Fast-path own-property enumeration and reduce descriptor lookups 2025-09-21 15:06:32 +02:00
Promise
Proxy Revert "LibJS: Reduce number of proxy traps called during for..in… 2025-03-21 11:44:21 -05:00
Reflect
RegExp LibJS: Create match indices based on code unit length 2025-07-22 23:11:19 +02:00
Set
ShadowRealm
SharedArrayBuffer
String LibJS: Implement 'less than' for a String over code units 2025-05-17 08:00:59 -04:00
SuppressedError
Symbol
Temporal LibJS: Ensure NudgeToCalendarUnit is given a non-zero duration sign 2025-08-29 01:14:20 +02:00
TypedArray Meta+LibJS: Update simdutf to version 7.3.3 2025-07-16 17:03:15 +02:00
WeakMap
WeakRef
WeakSet