<?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>226000</bug_id>
          
          <creation_ts>2021-05-19 19:24:31 -0700</creation_ts>
          <short_desc>AbstractSlotVisitor::containsOpaqueRoot() should only declare didFindOpaqueRoot if the root is actually found.</short_desc>
          <delta_ts>2021-05-19 20:34:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>ews-watchlist</cc>
    
    <cc>keith_miller</cc>
    
    <cc>msaboff</cc>
    
    <cc>rmorisset</cc>
    
    <cc>saam</cc>
    
    <cc>tzagallo</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1761809</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2021-05-19 19:24:31 -0700</bug_when>
    <thetext>It was erroneously calling didFindOpaqueRoot() all the time even when the root is not found.

rdar://78208014</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761812</commentid>
    <comment_count>1</comment_count>
      <attachid>429126</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2021-05-19 19:29:55 -0700</bug_when>
    <thetext>Created attachment 429126
proposed patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761814</commentid>
    <comment_count>2</comment_count>
      <attachid>429126</attachid>
    <who name="Robin Morisset">rmorisset</who>
    <bug_when>2021-05-19 19:35:25 -0700</bug_when>
    <thetext>Comment on attachment 429126
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=429126&amp;action=review

&gt; Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h:136
&gt; +    if (UNLIKELY(found &amp;&amp; m_needsExtraOpaqueRootHandling)) {

Is there a reason to check found first and m_needsExtraOpaqueRootHandling second?

If anything, I would expect the entire check of m_opaqueRoots.contains(ptr) to be only done after checking m_needsExtraOpaqueRootHandling, especially if it is UNLIKELY.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761815</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2021-05-19 19:37:52 -0700</bug_when>
    <thetext>(In reply to Robin Morisset from comment #2)
&gt; Comment on attachment 429126 [details]
&gt; proposed patch.
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=429126&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h:136
&gt; &gt; +    if (UNLIKELY(found &amp;&amp; m_needsExtraOpaqueRootHandling)) {
&gt; 
&gt; Is there a reason to check found first and m_needsExtraOpaqueRootHandling
&gt; second?
&gt; 
&gt; If anything, I would expect the entire check of m_opaqueRoots.contains(ptr)
&gt; to be only done after checking m_needsExtraOpaqueRootHandling, especially if
&gt; it is UNLIKELY.

I check found first because found is already in memory.  If not found, we save on triggering a load of m_needsExtraOpaqueRootHandling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761817</commentid>
    <comment_count>4</comment_count>
      <attachid>429126</attachid>
    <who name="Robin Morisset">rmorisset</who>
    <bug_when>2021-05-19 19:43:14 -0700</bug_when>
    <thetext>Comment on attachment 429126
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=429126&amp;action=review

r=me

&gt;&gt;&gt; Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h:136
&gt;&gt;&gt; +    if (UNLIKELY(found &amp;&amp; m_needsExtraOpaqueRootHandling)) {
&gt;&gt; 
&gt;&gt; Is there a reason to check found first and m_needsExtraOpaqueRootHandling second?
&gt;&gt; 
&gt;&gt; If anything, I would expect the entire check of m_opaqueRoots.contains(ptr) to be only done after checking m_needsExtraOpaqueRootHandling, especially if it is UNLIKELY.
&gt; 
&gt; I check found first because found is already in memory.  If not found, we save on triggering a load of m_needsExtraOpaqueRootHandling.

I had missed that we eventually return found and so we need to compute it even if !m_needsExtraOpaqueRootHandling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761818</commentid>
    <comment_count>5</comment_count>
      <attachid>429126</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2021-05-19 19:45:22 -0700</bug_when>
    <thetext>Comment on attachment 429126
proposed patch.

Thanks for the review.  Landing now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761823</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-05-19 20:34:36 -0700</bug_when>
    <thetext>Committed r277773 (237934@main): &lt;https://commits.webkit.org/237934@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429126.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>429126</attachid>
            <date>2021-05-19 19:29:55 -0700</date>
            <delta_ts>2021-05-19 20:34:38 -0700</delta_ts>
            <desc>proposed patch.</desc>
            <filename>bug-226000.patch</filename>
            <type>text/plain</type>
            <size>1678</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaG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cGxlLmNvbT4KIAogICAgICAgICBTcGVlZCB1cCBkZWJ1ZyB2YWxpZGF0aW9uIGlu
IENhY2hlYWJsZUlkZW50aWZpZXI6OmNyZWF0ZUZyb21JZGVudGlmaWVyT3duZWRCeUNvZGVCbG9j
aygpLgpJbmRleDogU291cmNlL0phdmFTY3JpcHRDb3JlL2hlYXAvQWJzdHJhY3RTbG90VmlzaXRv
cklubGluZXMuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvSmF2YVNjcmlwdENvcmUvaGVhcC9BYnN0
cmFjdFNsb3RWaXNpdG9ySW5saW5lcy5oCShyZXZpc2lvbiAyNzc3NTgpCisrKyBTb3VyY2UvSmF2
YVNjcmlwdENvcmUvaGVhcC9BYnN0cmFjdFNsb3RWaXNpdG9ySW5saW5lcy5oCSh3b3JraW5nIGNv
cHkpCkBAIC0xMzMsNyArMTMzLDcgQEAgaW5saW5lIGJvb2wgQWJzdHJhY3RTbG90VmlzaXRvcjo6
YWRkT3BhcQogaW5saW5lIGJvb2wgQWJzdHJhY3RTbG90VmlzaXRvcjo6Y29udGFpbnNPcGFxdWVS
b290KHZvaWQqIHB0cikgY29uc3QKIHsKICAgICBib29sIGZvdW5kID0gbV9vcGFxdWVSb290cy5j
b250YWlucyhwdHIpOwotICAgIGlmIChVTkxJS0VMWShtX25lZWRzRXh0cmFPcGFxdWVSb290SGFu
ZGxpbmcpKSB7CisgICAgaWYgKFVOTElLRUxZKGZvdW5kICYmIG1fbmVlZHNFeHRyYU9wYXF1ZVJv
b3RIYW5kbGluZykpIHsKICAgICAgICAgYXV0byogbm9uQ29uc3RUaGlzID0gY29uc3RfY2FzdDxB
YnN0cmFjdFNsb3RWaXNpdG9yKj4odGhpcyk7CiAgICAgICAgIG5vbkNvbnN0VGhpcy0+ZGlkRmlu
ZE9wYXF1ZVJvb3QocHRyKTsKICAgICB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>