mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
LibJS: Devirtualize Object::is_typed_array()
This commit is contained in:
parent
d154a758fa
commit
4cce181ece
2 changed files with 6 additions and 4 deletions
|
@ -184,7 +184,6 @@ public:
|
||||||
|
|
||||||
virtual bool is_dom_node() const { return false; }
|
virtual bool is_dom_node() const { return false; }
|
||||||
virtual bool is_function() const { return false; }
|
virtual bool is_function() const { return false; }
|
||||||
virtual bool is_typed_array() const { return false; }
|
|
||||||
virtual bool is_string_object() const { return false; }
|
virtual bool is_string_object() const { return false; }
|
||||||
virtual bool is_global_object() const { return false; }
|
virtual bool is_global_object() const { return false; }
|
||||||
virtual bool is_proxy_object() const { return false; }
|
virtual bool is_proxy_object() const { return false; }
|
||||||
|
@ -225,6 +224,9 @@ public:
|
||||||
|
|
||||||
static FlatPtr has_magical_length_property_offset() { return OFFSET_OF(Object, 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; }
|
||||||
|
void set_is_typed_array() { m_is_typed_array = true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum class GlobalObjectTag { Tag };
|
enum class GlobalObjectTag { Tag };
|
||||||
enum class ConstructWithoutPrototypeTag { Tag };
|
enum class ConstructWithoutPrototypeTag { Tag };
|
||||||
|
@ -244,6 +246,8 @@ protected:
|
||||||
|
|
||||||
bool m_has_magical_length_property { false };
|
bool m_has_magical_length_property { false };
|
||||||
|
|
||||||
|
bool m_is_typed_array { false };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_shape(Shape& shape) { m_shape = &shape; }
|
void set_shape(Shape& shape) { m_shape = &shape; }
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ protected:
|
||||||
, m_kind(kind)
|
, m_kind(kind)
|
||||||
, m_intrinsic_constructor(intrinsic_constructor)
|
, m_intrinsic_constructor(intrinsic_constructor)
|
||||||
{
|
{
|
||||||
|
set_is_typed_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 m_array_length { 0 };
|
u32 m_array_length { 0 };
|
||||||
|
@ -463,9 +464,6 @@ protected:
|
||||||
m_array_length = array_length;
|
m_array_length = array_length;
|
||||||
m_byte_length = m_viewed_array_buffer->byte_length();
|
m_byte_length = m_viewed_array_buffer->byte_length();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
virtual bool is_typed_array() const final { return true; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM&, FunctionObject& constructor, MarkedVector<Value> arguments);
|
ThrowCompletionOr<TypedArrayBase*> typed_array_create(VM&, FunctionObject& constructor, MarkedVector<Value> arguments);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue