LibJS: Use premade shape when creating unmapped arguments objects

Takes Speedometer2.1/EmberJS-Debug-TodoMVC from ~4500ms to ~4000ms
on my M3 MacBook Pro.
This commit is contained in:
Andreas Kling 2025-04-14 23:41:31 +02:00 committed by Andreas Kling
commit e8c351505e
Notes: github-actions[bot] 2025-04-15 11:09:54 +00:00
3 changed files with 36 additions and 6 deletions

View file

@ -40,6 +40,13 @@ public:
[[nodiscard]] u32 native_function_length_offset() const { return m_native_function_length_offset; }
[[nodiscard]] u32 native_function_name_offset() const { return m_native_function_name_offset; }
[[nodiscard]] GC::Ref<Shape> unmapped_arguments_object_shape() { return *m_unmapped_arguments_object_shape; }
[[nodiscard]] u32 unmapped_arguments_object_length_offset() const { return m_unmapped_arguments_object_length_offset; }
[[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<Accessor> throw_type_error_accessor() { return *m_throw_type_error_accessor; }
// Not included in JS_ENUMERATE_NATIVE_OBJECTS due to missing distinct prototype
GC::Ref<ProxyConstructor> proxy_constructor() { return *m_proxy_constructor; }
@ -157,6 +164,13 @@ private:
u32 m_native_function_length_offset { 0 };
u32 m_native_function_name_offset { 0 };
GC::Ptr<Shape> m_unmapped_arguments_object_shape;
u32 m_unmapped_arguments_object_length_offset { 0 };
u32 m_unmapped_arguments_object_well_known_symbol_iterator_offset { 0 };
u32 m_unmapped_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
GC::Ptr<ProxyConstructor> m_proxy_constructor;