[Webkit-unassigned] [Bug 223613] JSGlobalObject's m_customGetterFunctionMap and m_customSetterFunctionMap should be sets, not maps, and should use both the identifier and function pointer as the key

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 22 17:34:54 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=223613

--- Comment #4 from Sam Weinig <sam at webkit.org> ---
(In reply to Alexey Shvayka from comment #3)
> (In reply to Sam Weinig from comment #2)
> > But, if we can use a set instead, we could take advantage of the fact that
> > the JSCustomGetterFunction already stores the PropertyName and GetValueFunc.
> > And thus, rather than increase size, we could actually make these a bit
> > smaller, since the buckets would now just be Weak<JSCustomGetterFunction>.
> 
> Oh, thanks, makes total sense.
> 
> Wouldn't that slow down the value lookup to O(N)? If so, I guess it's
> tolerable for Object.getOwnPropertyDescriptor().

I don't think so, but perhaps you are thinking of something I have missed. It should still be O(1). It's essentially just going from 

   HashMap<GetValueFunc, Weak<JSCustomGetterFunction>> 

to 

   HashSet<Weak<JSCustomGetterFunction>, CustomHashTraits>


The question is, can I figure out how to make that work (I am not convinced I can).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210323/cf957c2b/attachment.htm>


More information about the webkit-unassigned mailing list