mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibJS: Add fast_is<T> for JS::Array (array exotic objects)
Nukes a 0.3% profile item on Speedometer 2.1.
This commit is contained in:
parent
6507d23e29
commit
e80d1c1a86
Notes:
github-actions[bot]
2025-04-12 09:08:59 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/e80d1c1a86b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4328
2 changed files with 6 additions and 0 deletions
|
@ -58,11 +58,16 @@ protected:
|
|||
explicit Array(Object& prototype);
|
||||
|
||||
private:
|
||||
virtual bool is_array_exotic_object() const final { return true; }
|
||||
|
||||
ThrowCompletionOr<bool> set_length(PropertyDescriptor const&);
|
||||
|
||||
bool m_length_writable { true };
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Object::fast_is<Array>() const { return is_array_exotic_object(); }
|
||||
|
||||
enum class Holes {
|
||||
SkipHoles,
|
||||
ReadThroughHoles,
|
||||
|
|
|
@ -198,6 +198,7 @@ public:
|
|||
virtual bool is_regexp_object() const { return false; }
|
||||
virtual bool is_bigint_object() const { return false; }
|
||||
virtual bool is_string_object() const { return false; }
|
||||
virtual bool is_array_exotic_object() const { return false; }
|
||||
virtual bool is_global_object() const { return false; }
|
||||
virtual bool is_proxy_object() const { return false; }
|
||||
virtual bool is_native_function() const { return false; }
|
||||
|
|
Loading…
Add table
Reference in a new issue