<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#c16">Comment # 16</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=294533&amp;action=diff" name="attach_294533" title="Patch">attachment 294533</a> <a href="attachment.cgi?id=294533&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2199
&gt; +    dst = tempDestination(dst);</span >

Yeah, you're right. dst could be nullptr. However, you don't want to use tempDestination here, you want finalDestination.

<span class="quote">&gt;&gt;&gt; Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2217
&gt;&gt;&gt; +    instructions().append(localScopeDepth());
&gt;&gt; 
&gt;&gt; Why not just make the access off the base-most scope of the eval instead of having a local scope depth? We should already have the scope on the symbol table stack, right?
&gt; 
&gt; Ohh, not sure if I got how I can do this.</span >

The first thing that the bytecode generator does is emit a get_scope.
You'll just need to make sure to record what RegisterID* is that scope inside BytecodeGenerator(Eval) constructor, and then your operation can just work off that scope, instead of having to record the localDepth().
This localDepth() just adds more complexity to what you're trying to do for no reason IMO.</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>