Summary: | Make elements with attributes smaller by eliminating the reference count in NamedNodeMap | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Darin Adler <darin> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | adamk, cdumez, kling, ojan, rniwa, sam | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Darin Adler
2011-12-21 23:34:48 PST
(In reply to comment #0) > We should remove the separate reference count stored in each NamedNodeMap. An easy immediate way to do that would be by using OwnPtr instead of RefPtr to hold the map on each Element, and changing the ref and deref functions to simply ref and deref the owning element instead of the map itself. I'm not sure which ref/deref functions you're talking about. Could you elaborate a little? NamedNodeMap would no longer derive from RefCounted. Instead it would implement ref and deref like this: void ref() { m_element->ref(); } void deref() { m_element->deref(); } The JavaScript bindings, and any other code for that matter, can still use a RefPtr on the NamedNodeMap, but the actual reference counting is done on the element, which is fine since the lifetimes of the two objects are tied together. Created attachment 121242 [details]
Proposed patch
Comment on attachment 121242 [details]
Proposed patch
r=me
Comment on attachment 121242 [details] Proposed patch Clearing flags on attachment: 121242 Committed r104130: <http://trac.webkit.org/changeset/104130> All reviewed patches have been landed. Closing bug. Comment on attachment 121242 [details]
Proposed patch
In the future, when improving the size of an class, consider adding a COMPILE_ASSERT of the size so that we can keep it from regressing in the future.
Mass moving XML DOM bugs to the "DOM" Component. |