LibJS: Use premade shape when creating mapped arguments objects

Knocks out a 0.4% profile item on Speedometer 3.
This commit is contained in:
Andreas Kling 2025-04-18 18:11:10 +02:00 committed by Andreas Kling
commit e0b32b1863
Notes: github-actions[bot] 2025-04-18 23:14:55 +00:00
4 changed files with 25 additions and 5 deletions

View file

@ -45,6 +45,11 @@ public:
[[nodiscard]] u32 unmapped_arguments_object_well_known_symbol_iterator_offset() const { return m_unmapped_arguments_object_well_known_symbol_iterator_offset; }
[[nodiscard]] u32 unmapped_arguments_object_callee_offset() const { return m_unmapped_arguments_object_callee_offset; }
[[nodiscard]] GC::Ref<Shape> mapped_arguments_object_shape() { return *m_mapped_arguments_object_shape; }
[[nodiscard]] u32 mapped_arguments_object_length_offset() const { return m_mapped_arguments_object_length_offset; }
[[nodiscard]] u32 mapped_arguments_object_well_known_symbol_iterator_offset() const { return m_mapped_arguments_object_well_known_symbol_iterator_offset; }
[[nodiscard]] u32 mapped_arguments_object_callee_offset() const { return m_mapped_arguments_object_callee_offset; }
[[nodiscard]] GC::Ref<Accessor> throw_type_error_accessor() { return *m_throw_type_error_accessor; }
// Not included in JS_ENUMERATE_NATIVE_OBJECTS due to missing distinct prototype
@ -169,6 +174,11 @@ private:
u32 m_unmapped_arguments_object_well_known_symbol_iterator_offset { 0 };
u32 m_unmapped_arguments_object_callee_offset { 0 };
GC::Ptr<Shape> m_mapped_arguments_object_shape;
u32 m_mapped_arguments_object_length_offset { 0 };
u32 m_mapped_arguments_object_well_known_symbol_iterator_offset { 0 };
u32 m_mapped_arguments_object_callee_offset { 0 };
GC::Ptr<Accessor> m_throw_type_error_accessor;
// Not included in JS_ENUMERATE_NATIVE_OBJECTS due to missing distinct prototype