mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibJS+LibWeb: Use GC::Weak instead of AK::WeakPtr for GC-allocated types
This makes some common types like JS::Object smaller (by 8 bytes) and yields a minor speed improvement on many benchmarks.
This commit is contained in:
parent
25a5ed94d6
commit
dfa796a4e4
Notes:
github-actions[bot]
2025-10-17 15:25:08 +00:00
Author: https://github.com/awesomekling
Commit: dfa796a4e4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6496
36 changed files with 111 additions and 115 deletions
|
@ -247,25 +247,25 @@ Vector<String> ARIAMixin::parse_id_reference_list(Optional<String> const& id_lis
|
|||
ENUMERATE_ARIA_ELEMENT_REFERENCING_ATTRIBUTES
|
||||
#undef __ENUMERATE_ARIA_ATTRIBUTE
|
||||
|
||||
#define __ENUMERATE_ARIA_ATTRIBUTE(attribute, referencing_attribute) \
|
||||
Optional<Vector<WeakPtr<DOM::Element>>> const& ARIAMixin::attribute() const \
|
||||
{ \
|
||||
return m_##attribute; \
|
||||
} \
|
||||
\
|
||||
void ARIAMixin::set_##attribute(Optional<Vector<WeakPtr<DOM::Element>>> value) \
|
||||
{ \
|
||||
m_##attribute = move(value); \
|
||||
} \
|
||||
\
|
||||
GC::Ptr<JS::Array> ARIAMixin::cached_##attribute() const \
|
||||
{ \
|
||||
return m_cached_##attribute; \
|
||||
} \
|
||||
\
|
||||
void ARIAMixin::set_cached_##attribute(GC::Ptr<JS::Array> value) \
|
||||
{ \
|
||||
m_cached_##attribute = value; \
|
||||
#define __ENUMERATE_ARIA_ATTRIBUTE(attribute, referencing_attribute) \
|
||||
Optional<Vector<GC::Weak<DOM::Element>>> const& ARIAMixin::attribute() const \
|
||||
{ \
|
||||
return m_##attribute; \
|
||||
} \
|
||||
\
|
||||
void ARIAMixin::set_##attribute(Optional<Vector<GC::Weak<DOM::Element>>> value) \
|
||||
{ \
|
||||
m_##attribute = move(value); \
|
||||
} \
|
||||
\
|
||||
GC::Ptr<JS::Array> ARIAMixin::cached_##attribute() const \
|
||||
{ \
|
||||
return m_cached_##attribute; \
|
||||
} \
|
||||
\
|
||||
void ARIAMixin::set_cached_##attribute(GC::Ptr<JS::Array> value) \
|
||||
{ \
|
||||
m_cached_##attribute = value; \
|
||||
}
|
||||
ENUMERATE_ARIA_ELEMENT_LIST_REFERENCING_ATTRIBUTES
|
||||
#undef __ENUMERATE_ARIA_ATTRIBUTE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue