<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>52504</bug_id>
          
          <creation_ts>2011-01-14 18:55:32 -0800</creation_ts>
          <short_desc>Add PassPosition to avoid refcount thrashing</short_desc>
          <delta_ts>2011-02-04 10:20:06 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>enrica</cc>
    
    <cc>eric</cc>
    
    <cc>ojan</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>334814</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-14 18:55:32 -0800</bug_when>
    <thetext>Currently, Position&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>334815</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-14 18:58:02 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343578</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-02-01 15:07:48 -0800</bug_when>
    <thetext>It seems like helper functions in Position.h are inline and therefore does not cause ref-count churn.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>345587</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-02-04 10:20:06 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; 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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>