[Webkit-unassigned] [Bug 222518] Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 16 09:31:36 PDT 2021


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

--- Comment #7 from Sam Weinig <sam at webkit.org> ---
(In reply to Sam Sneddon [:gsnedders] from comment #4)
> (In reply to Sam Weinig from comment #1)
> > A very simple idea, but with a runtime cost (though unlikely a runtime
> > regression from the legacy code currently in the build, we should test)
> > would be to replace all the getter / setters implementations with a single
> > pair that re-lookup the name. Unfortunately, it seems only getters are
> > passed their name in the callback, so at best (without making changes to
> > JSC) we only be able to replace half the functions.
> 
> I'd be curious about why JSC has that asymmetry? At the spec level, neither
> getters nor setters are passed their names, so presumably there's some
> reason for this in JSC?

I kind of doubt there is a good reason, probably just driven by needs since this is all internals stuff.

> 
> Also: how big is the binary size regression at this point? Is it just the
> generated getter/setter functions that dominate the regression?

Not sure at this point. It would be good to measure.


I have two ideas about to proceed here:

1) Add a PropertyName parameter to the custom setters, and implement a single set of getter/setters based on the property name parameter.

2) Add a mechanism to smuggle a parameter to the custom getter/setters stored that we store in the DOMAttributeGetterSetter at re-ification time during the prototype's creation. We could avoid making DOMAttributeGetterSetter bigger by utilizing the DOMAttributeAnnotation's domJIT pointer, which is always null in this case (and in most cases).


After sleeping on it, I'm somewhat leaning towards doing #1 first, just to see what if there is performance cost and if it fixes the compile time regression, as either solution is going to grow the number of parameters passed to custom setters by 1, and that scares me a bit.

-- 
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/20210316/35b62248/attachment.htm>


More information about the webkit-unassigned mailing list