Bug 52504
Summary: | Add PassPosition to avoid refcount thrashing | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | DOM | Assignee: | Ryosuke Niwa <rniwa> |
Status: | RESOLVED INVALID | ||
Severity: | Enhancement | CC: | ap, darin, enrica, eric, ojan, tony |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Ryosuke Niwa
Currently, Position's convenience functions return an instance of Position which results in multiple refcount update for the anchor node. We should add PassPosition that acts like PassRefPtr for RefPtr to avoid this.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
We can also create special classes for positions before/after node so that they only contains a pointer and therefore fits in a single register.
Ryosuke Niwa
It seems like helper functions in Position.h are inline and therefore does not cause ref-count churn.
Darin Adler
(In reply to comment #2)
> It seems like helper functions in Position.h are inline and therefore does not cause ref-count churn.
Inlining should have no effect on this. Could you show me some evidence, perhaps disassembly of compiled code, that there is no increment and decrement of reference counts going on? I am almost certain there is churn.