<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 - Web Inspector: Possible unexpected tail call optimization issue, sourceURL lost from eval() source"
   href="https://bugs.webkit.org/show_bug.cgi?id=153626">153626</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Web Inspector: Possible unexpected tail call optimization issue, sourceURL lost from eval() source
          </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>joepeck&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>ggaren&#64;apple.com, msaboff&#64;apple.com, sbarati&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>* SUMMARY
Possible unexpected tail call optimization issue, sourceURL lost from eval() source

* STEPS TO REPRODUCE
1. Attach the attached patch containing (LayoutTests/inspector/sampling-profiler/eval-source-url-2.html)
2. shell&gt; run-webkit-tests LayoutTests/inspector/sampling-profiler/eval-source-url-2.html
  =&gt; FAIL

* NOTES
- Compare inspector/sampling-profiler/eval-source-url-2.html to inspector/sampling-profiler/eval-source-url.html
- The only difference is bar():

inspector/sampling-profiler/eval-source-url-2.html:
<span class="quote">&gt; function bar() {
&gt;     for (let i = 0; i &lt; 2; i++)
&gt;         eval(&quot;//# sourceURL=eval.js\nfoo();&quot;);
&gt; }</span >

inspector/sampling-profiler/eval-source-url.html:
<span class="quote">&gt; function bar() {
&gt;     eval(&quot;//# sourceURL=eval.js\nfoo();&quot;);
&gt; }</span >

For some reason, the Sampling Profiler doesn't see the &quot;eval.js&quot; sourceURL for the eval executable.

This showed up after no longer enabling the legacy profiling. One of the things that did was flip this bit:

    bytecompiler/BytecodeGenerator.cpp
    // FIXME: We should be able to have tail call elimination with the profiler
    // enabled. This is currently not possible because the profiler expects
    // op_will_call / op_did_call pairs before and after a call, which are not
    // compatible with tail calls (we have no way of emitting op_did_call).
    // <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Enabling the profiler shouldn't prevent us from performing tail call elimination"
   href="show_bug.cgi?id=148819">https://bugs.webkit.org/show_bug.cgi?id=148819</a>
    , m_inTailPosition(Options::useTailCalls() &amp;&amp; !isConstructor() &amp;&amp; constructorKind() == ConstructorKind::None &amp;&amp; isStrictMode() &amp;&amp; !m_shouldEmitProfileHooks)

Toggling that did in fact make the test pass again.</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>