<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ObjectAllocationSinkingPhase::insertOSRHintsForUpdate() fails to emit updated hints in some cases"
   href="https://bugs.webkit.org/show_bug.cgi?id=161492">161492</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ObjectAllocationSinkingPhase::insertOSRHintsForUpdate() fails to emit updated hints in some cases
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fpizlo&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This seems to cause trouble:

a: CreateActivation()
MovHint(&#64;a, loc1)
b: NewFunction(&#64;a)
MovHint(&#64;b, loc2)
c: NewFunction(&#64;b)
MovHint(&#64;c, loc3)
Escape(&#64;b)

I'm seeing code like this:

a: PhantomCreateActivation()
MovHint(&#64;a, loc1)
b: PhantomNewFunction(&#64;a)
PutHint(&#64;b, &#64;a, scope)
MovHint(&#64;b, loc2)
c: PhantomNewFunction(&#64;b)
PutHint(&#64;c, &#64;a, scope)
MovHint(&#64;c, loc3)
d: MaterializeCreateActivation()
e: NewFunction(&#64;d)
MovHint(&#64;d, loc1)
MovHint(&#64;e, loc2)
Escape(&#64;e)

But this is wrong, because if we exit, then we will recreate &#64;c pointing at a newly materialized activation, rather than at &#64;d.  In other words, the phase should have produced this code instead:

a: PhantomCreateActivation()
MovHint(&#64;a, loc1)
b: PhantomNewFunction(&#64;a)
PutHint(&#64;b, &#64;a, scope)
MovHint(&#64;b, loc2)
c: PhantomNewFunction(&#64;b)
PutHint(&#64;c, &#64;a, scope)
MovHint(&#64;c, loc3)
d: MaterializeCreateActivation()
e: NewFunction(&#64;d)
PutHint(&#64;c, &#64;e, scope)   &lt;---- THIS
MovHint(&#64;d, loc1)
MovHint(&#64;e, loc2)
Escape(&#64;e)

The phase seems to have code to do this.  I'm still investigating what goes wrong.</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>