Bug 251749 - Optimize layout of AbortSignal to reduce padding
Summary: Optimize layout of AbortSignal to reduce padding
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-02-04 20:00 PST by Simon Fraser (smfr)
Modified: 2023-02-06 09:19 PST (History)
7 users (show)

See Also:


Attachments
Patch (1.92 KB, patch)
2023-02-04 20:13 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 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 %
Comment 1 Radar WebKit Bug Importer 2023-02-04 20:12:27 PST
<rdar://problem/105048992>
Comment 2 Simon Fraser (smfr) 2023-02-04 20:13:20 PST
Created attachment 464843 [details]
Patch
Comment 3 EWS 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].