Use DOMConstructor array instead of HashMap since window constructor property access is critical
Created attachment 431168 [details] Patch
Created attachment 431170 [details] Patch
Comment on attachment 431170 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431170&action=review > Source/WebCore/ChangeLog:12 > + preprocess-idls.pl collects all constructors and assign DOMConstructor::XXX enum to each constructor. And it also counts What about constructors added at runtime (e.g. the ones marked as [EnabledAtRuntime] or [EnabledBySetting]) ?
Comment on attachment 431170 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431170&action=review >> Source/WebCore/ChangeLog:12 >> + preprocess-idls.pl collects all constructors and assign DOMConstructor::XXX enum to each constructor. And it also counts > > What about constructors added at runtime (e.g. the ones marked as [EnabledAtRuntime] or [EnabledBySetting]) ? Regardless of whether it is defined at runtime, we have ID for that constructor.
Created attachment 431171 [details] Patch
Committed r278802 (238759@main): <https://commits.webkit.org/238759@main>
<rdar://problem/79226523>
Comment on attachment 431171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431171&action=review > Source/WebCore/bindings/js/JSDOMGlobalObject.h:127 > + std::unique_ptr<DOMConstructors> m_constructors; Can this be std::unique_ptr<const DOMConstructors>? If not, why not?
Nice. Should we do this for the DOM Structures map too?
Comment on attachment 431171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431171&action=review >> Source/WebCore/bindings/js/JSDOMGlobalObject.h:127 >> + std::unique_ptr<DOMConstructors> m_constructors; > > Can this be std::unique_ptr<const DOMConstructors>? If not, why not? Because DOMConstructors will be modified :)
(In reply to Sam Weinig from comment #9) > Nice. Should we do this for the DOM Structures map too? Possibly yes :) Or, we could extend it to using LazyClassStructure (which can hold construtors and structures)