<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Remove AllocationProfileWatchpoint node"
   href="https://bugs.webkit.org/show_bug.cgi?id=143999#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Remove AllocationProfileWatchpoint node"
   href="https://bugs.webkit.org/show_bug.cgi?id=143999">bug 143999</a>
              from <span class="vcard"><a class="email" href="mailto:fpizlo&#64;apple.com" title="Filip Pizlo &lt;fpizlo&#64;apple.com&gt;"> <span class="fn">Filip Pizlo</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=251246&amp;action=diff" name="attach_251246" title="Tentative patch, non thread-safe">attachment 251246</a> <a href="attachment.cgi?id=251246&amp;action=edit" title="Tentative patch, non thread-safe">[details]</a></span>
Tentative patch, non thread-safe

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=251246&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=251246&amp;action=review</a>

<span class="quote">&gt;&gt; Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:2643
&gt;&gt;                  if (Structure* structure = function-&gt;allocationStructure()) {
&gt; 
&gt; We probably need to freeze the rare data here, in case it is removed by the JS thread and then the GC runs at that point.
&gt; Not sure how to do this, I first need to investigate more deeply how freeze() &amp; the GC works.</span >

It seems that you're using JSFunction's helpers to get things from the rare data.  I would make this explicit here, so instead of function-&gt;allocationStructure() you'd do something like rareData-&gt;allocationStructure().  And instead of function-&gt;allocationProfileWatchpointSet() you'd do rareData-&gt;allocationProfileWatchpointSet().

Then you'd do:

FunctionRareData* rareData = function-&gt;rareData();
if (rareData) {
    if (Structure* structure = rareData-&gt;structure()) {
        m_graph.freeze(rareData);
        m_graph.watchpoints().addLazily(rareData-&gt;allocationProfileWatchpointSet()); // note that here you don't have to do any null checking - you know that rareData has the InlineWatchpointSet in place rather than via pointer.
        ... the rest
    }
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>