RESOLVED FIXED 251749
Optimize layout of AbortSignal to reduce padding
https://bugs.webkit.org/show_bug.cgi?id=251749
Summary Optimize layout of AbortSignal to reduce padding
Simon Fraser (smfr)
Reported 2023-02-04 20:00:08 PST
Before: OpenSource % /usr/bin/python3 ./Tools/Scripts/dump-class-layout -c Release WebCore AbortSignal +0 <112> WebCore::AbortSignal +0 < 24> <PADDING: 24 bytes> +24 < 4> WTF::RefCounted<WebCore::AbortSignal, std::__1::default_delete<WebCore::AbortSignal> > WTF::RefCounted<WebCore::AbortSignal, std::__1::default_delete<WebCore::AbortSignal> > +24 < 4> WTF::RefCountedBase WTF::RefCountedBase +24 < 4> unsigned int m_refCount +0 < 24> WebCore::EventTarget WebCore::EventTarget +0 < 8> __vtbl_ptr_type * _vptr +8 < 8> WebCore::ScriptWrappable WebCore::ScriptWrappable +8 < 8> JSC::Weak<WebCore::JSDOMObject> m_wrapper +8 < 8> JSC::WeakImpl * m_impl +16 < 8> WTF::CanMakeWeakPtr<WebCore::EventTarget, WTF::WeakPtrFactoryInitialization::Lazy, WebCore::WeakPtrImplWithEventTargetData> WTF::CanMakeWeakPtr<WebCore::EventTarget, WTF::WeakPtrFactoryInitialization::Lazy, WebCore::WeakPtrImplWithEventTargetData> +16 < 8> WTF::WeakPtrFactory<WebCore::EventTarget, WebCore::WeakPtrImplWithEventTargetData> m_weakPtrFactory +16 < 8> WTF::CompactRefPtrTuple<WebCore::WeakPtrImplWithEventTargetData, unsigned short> m_impl +16 < 8> WTF::CompactPointerTuple<WebCore::WeakPtrImplWithEventTargetData *, unsigned short> m_data +16 < 8> uint64_t m_data +24 < 8> <PADDING: 8 bytes> +32 < 16> WebCore::ContextDestructionObserver WebCore::ContextDestructionObserver +32 < 8> __vtbl_ptr_type * _vptr +40 < 8> WebCore::ScriptExecutionContext * m_scriptExecutionContext +48 < 1> bool m_aborted +49 < 7> <PADDING: 7 bytes> +56 < 16> WTF::Vector<std::__1::pair<unsigned int, WTF::Function<void (JSC::JSValue)> >, 0, WTF::CrashOnOverflow, 16, WTF::FastMalloc> m_algorithms +56 < 16> WTF::VectorBuffer<std::__1::pair<unsigned int, WTF::Function<void (JSC::JSValue)> >, 0, WTF::FastMalloc> WTF::VectorBuffer<std::__1::pair<unsigned int, WTF::Function<void (JSC::JSValue)> >, 0, WTF::FastMalloc> +56 < 16> WTF::VectorBufferBase<std::__1::pair<unsigned int, WTF::Function<void (JSC::JSValue)> >, WTF::FastMalloc> WTF::VectorBufferBase<std::__1::pair<unsigned int, WTF::Function<void (JSC::JSValue)> >, WTF::FastMalloc> +56 < 8> std::__1::pair<unsigned int, WTF::Function<void (JSC::JSValue)> > * m_buffer +64 < 4> unsigned int m_capacity +68 < 4> unsigned int m_size +72 < 4> uint32_t m_algorithmIdentifier +76 < 4> <PADDING: 4 bytes> +80 < 8> WTF::WeakPtr<WebCore::AbortSignal, WebCore::WeakPtrImplWithEventTargetData> m_followingSignal +80 < 8> WTF::RefPtr<WebCore::WeakPtrImplWithEventTargetData, WTF::RawPtrTraits<WebCore::WeakPtrImplWithEventTargetData>, WTF::DefaultRefDerefTraits<WebCore::WeakPtrImplWithEventTargetData> > m_impl +80 < 8> WTF::RawPtrTraits<WebCore::WeakPtrImplWithEventTargetData>::StorageType m_ptr +88 < 16> WebCore::JSValueInWrappedObject m_reason +88 < 8> JSC::JSValue m_nonCell +88 < 8> JSC::EncodedValueDescriptor u +96 < 8> JSC::Weak<JSC::JSCell> m_cell +96 < 8> JSC::WeakImpl * m_impl +104 < 1> bool m_hasActiveTimeoutTimer +105 < 1> bool m_hasAbortEventListener +106 < 6> <PADDING: 6 bytes> Total byte size: 112 Total pad bytes: 49 Padding percentage: 43.75 %
Attachments
Patch (1.92 KB, patch)
2023-02-04 20:13 PST, Simon Fraser (smfr)
no flags
Radar WebKit Bug Importer
Comment 1 2023-02-04 20:12:27 PST
Simon Fraser (smfr)
Comment 2 2023-02-04 20:13:20 PST
EWS
Comment 3 2023-02-06 09:19:31 PST
Committed 259897@main (e60034e6433d): <https://commits.webkit.org/259897@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 464843 [details].
Note You need to log in before you can comment on or make changes to this bug.