<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6]. Implement Annex B.3.3 function hoisting rules for eval"
   href="https://bugs.webkit.org/show_bug.cgi?id=163208#c58">Comment # 58</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6]. Implement Annex B.3.3 function hoisting rules for eval"
   href="https://bugs.webkit.org/show_bug.cgi?id=163208">bug 163208</a>
              from <span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=302546&amp;action=diff" name="attach_302546" title="Patch">attachment 302546</a> <a href="attachment.cgi?id=302546&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

Mostly LGTM. Just a couple of questions and a recommendation.

<span class="quote">&gt; Source/JavaScriptCore/bytecode/BytecodeList.json:156
&gt; +            { &quot;name&quot; : &quot;op_resolve_scope_for_binding_func_decl_in_eval&quot;, &quot;length&quot; : 4 }</span >

Can we call this:
&quot;op_resolve_scope_for_hoisting_func_decl_in_eval&quot;
I think having the word &quot;hoisting&quot; in here will help everyone better understand what this opcode is doing.
(Also, can you change the various C++ functions that have &quot;binding&quot; in the name to &quot;hoisting&quot; or &quot;hoist&quot;)

<span class="quote">&gt; Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:1063
&gt; +        case ResolveScopeForBindingFuncDeclInEval:
&gt; +            compileResolveScopeForBindingFuncDeclInEval();
&gt; +            break;</span >

You need to say that the FTL supports this opcode inside FTLCapabilities.cpp.
Please verify that this gets compiled in some of your tests, or add new tests that make it to the FTL.

<span class="quote">&gt; Source/JavaScriptCore/interpreter/Interpreter.cpp:1148
&gt; +            for (int i = 0; i &lt; numFunctions; ++i) {</span >

Why are there both &quot;numFunctions&quot; and &quot;numHoistedFunctions&quot;. Isn't every function declaration in an eval a hoisting candidate?</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>