[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:17:21 PDT 2021


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

--- Comment #2 from Sam Weinig <sam at webkit.org> ---
(In reply to Alexey Shvayka from comment #1)
> (In reply to Sam Weinig from comment #0)
> > JSGlobalObject's m_customGetterFunctionMap and m_customSetterFunctionMap
> > should be sets, not maps, and should use both the identifier and function
> > pointer as the key.
> 
> Could please expand why they need to be sets, and if so, how JSFunctions
> would be stored? Agreed on the second part though.

Right, I forgot to explain that part :).

If we just change m_customGetterFunctionMap (and m_customSetterFunctionMap) from:

WeakGCMap<GetValueFunc, JSCustomGetterFunction>

to

WeakGCMap<std::pair<PropertyName, GetValueFunc>, JSCustomGetterFunction> 

we would increase the size of the maps considerably.

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>.

The problem is there isn't a WeakGCSet class yet, so I'll have to figure out if it's possible to make one for a case like this.

-- 
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/ba9d6ef1/attachment.htm>


More information about the webkit-unassigned mailing list