Bug 52504 - Add PassPosition to avoid refcount thrashing
Summary: Add PassPosition to avoid refcount thrashing
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 18:55 PST by Ryosuke Niwa
Modified: 2011-02-04 10:20 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 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.
Comment 1 Ryosuke Niwa 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.
Comment 2 Ryosuke Niwa 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.
Comment 3 Darin Adler 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.