RESOLVED INVALID 52504
Add PassPosition to avoid refcount thrashing
https://bugs.webkit.org/show_bug.cgi?id=52504
Summary Add PassPosition to avoid refcount thrashing
Ryosuke Niwa
Reported 2011-01-14 18:55:32 PST
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
Ryosuke Niwa
Comment 1 2011-01-14 18:58:02 PST
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
Comment 2 2011-02-01 15:07:48 PST
It seems like helper functions in Position.h are inline and therefore does not cause ref-count churn.
Darin Adler
Comment 3 2011-02-04 10:20:06 PST
(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.
Note You need to log in before you can comment on or make changes to this bug.