mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibJS/Bytecode: Inline indexed property access in GetByVal better
This commit is contained in:
parent
3170ad2ee3
commit
161298b5d1
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/awesomekling
Commit: 161298b5d1
Pull-request: https://github.com/SerenityOS/serenity/pull/24260
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/mattco98
3 changed files with 20 additions and 5 deletions
|
@ -22,14 +22,12 @@ SimpleIndexedPropertyStorage::SimpleIndexedPropertyStorage(Vector<Value>&& initi
|
|||
|
||||
bool SimpleIndexedPropertyStorage::has_index(u32 index) const
|
||||
{
|
||||
return index < m_array_size && !m_packed_elements[index].is_empty();
|
||||
return inline_has_index(index);
|
||||
}
|
||||
|
||||
Optional<ValueAndAttributes> SimpleIndexedPropertyStorage::get(u32 index) const
|
||||
{
|
||||
if (!has_index(index))
|
||||
return {};
|
||||
return ValueAndAttributes { m_packed_elements[index], default_attributes };
|
||||
return inline_get(index);
|
||||
}
|
||||
|
||||
void SimpleIndexedPropertyStorage::grow_storage_if_needed()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue