LibJS: Convert Object bitfields to a flags byte

Replace individual bool bitfields in Object (m_is_extensible,
m_has_parameter_map, m_has_magical_length_property, etc.) with a
single u8 m_flags field and Flag:: constants.

This consolidates 8 scattered bitfields into one byte with explicit
bit positions, making them easy to access from generated assembly
code at a known offset. It also converts the virtual is_function()
and is_ecmascript_function_object() methods to flag-based checks,
avoiding virtual dispatch for these hot queries.

ProxyObject now explicitly clears the IsFunction flag in its
constructor when wrapping a non-callable target, instead of relying
on a virtual is_function() override.
This commit is contained in:
Andreas Kling
2026-03-06 22:05:13 +01:00
committed by Andreas Kling
parent 643f2884cc
commit c5427e5f4e
Notes: github-actions[bot] 2026-03-07 12:12:35 +00:00
10 changed files with 68 additions and 47 deletions

View File

@@ -117,7 +117,7 @@ ThrowCompletionOr<bool> StringObject::internal_define_own_property(PropertyKey c
// 2. If stringDesc is not undefined, then
if (string_descriptor.has_value()) {
// a. Let extensible be S.[[Extensible]].
auto extensible = m_is_extensible;
auto extensible = this->extensible();
// b. Return IsCompatiblePropertyDescriptor(extensible, Desc, stringDesc).
return is_compatible_property_descriptor(extensible, property_descriptor, string_descriptor);