Devirtualize some functions on InputType
Created attachment 418705 [details] Patch
Can use bitfields & OptionSet??
Do you want a bit per Type, and then masks for isTextType etc?
Possibly, using uint32_t width for InputType::Type and using OptionSet to filter out several types (e.g. isTextType(), isSteppable() etc.) would be OK because of the current InputType layout. +0 < 24> WebCore::InputType +0 < 8> __vtbl_ptr_type * _vptr +8 < 4> WTF::RefCounted<WebCore::InputType, std::__1::default_delete<WebCore::InputType> > WTF::RefCounted<WebCore::InputType, std::__1::default_delete<WebCore::InputType> > +8 < 4> WTF::RefCountedBase WTF::RefCountedBase +8 < 4> unsigned int m_refCount +12 < 1> const WebCore::InputType::Type m_type +13 < 3> <PADDING: 3 bytes> +16 < 8> WTF::WeakPtr<WebCore::HTMLInputElement, WTF::EmptyCounter> m_element +16 < 8> WTF::RefPtr<WTF::WeakPtrImpl<WTF::EmptyCounter>, WTF::RawPtrTraits<WTF::WeakPtrImpl<WTF::EmptyCounter> >, WTF::DefaultRefDerefTraits<WTF::WeakPtrImpl<WTF::EmptyCounter> > > m_impl +16 < 8> WTF::RawPtrTraits<WTF::WeakPtrImpl<WTF::EmptyCounter> >::StorageType m_ptr Total byte size: 24 Total pad bytes: 3 Padding percentage: 12.50 %
(In reply to Simon Fraser (smfr) from comment #3) > Do you want a bit per Type, and then masks for isTextType etc? Yeah, that would work. Alternatively, we can just define an enum value for each type, and then things like Type::Text can just be its (own bit flag) | Type::IsTextType and so forth.
Created attachment 418747 [details] Patch
Comment on attachment 418747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=418747&action=review r=me > Source/WebCore/html/InputType.h:162 > + bool isDateTimeField() const { return false; } Let's remove this `isDateTimeField` since "input datetime" is not supported in WebKit, and possibly never supported since it is deprecated. > Source/WebCore/html/InputType.h:322 > virtual bool isEnumeratable(); Let's make isEnumeratable non-virtual since it is no longer using virtual overrides.
Created attachment 418752 [details] Patch
Committed r272097: <https://trac.webkit.org/changeset/272097> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418752 [details].
<rdar://problem/73781798>