1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:57:34 +00:00

LibJS: Add fast path for magical "length" property in LengthOfArrayLike

For Array objects, we can avoid a generic Get here since we know it has
magical "length" behavior anyway.
This commit is contained in:
Andreas Kling 2023-12-08 12:34:42 +01:00
parent 8e5f201e59
commit 73ceb475b9
2 changed files with 5 additions and 0 deletions

View file

@ -224,6 +224,7 @@ public:
static FlatPtr may_interfere_with_indexed_property_access_offset() { return OFFSET_OF(Object, m_may_interfere_with_indexed_property_access); }
static FlatPtr indexed_properties_offset() { return OFFSET_OF(Object, m_indexed_properties); }
[[nodiscard]] bool has_magical_length_property() const { return m_has_magical_length_property; }
static FlatPtr has_magical_length_property_offset() { return OFFSET_OF(Object, m_has_magical_length_property); }
[[nodiscard]] bool is_typed_array() const { return m_is_typed_array; }