[Webkit-unassigned] [Bug 163208] [ES6]. Implement Annex B.3.3 function hoisting rules for eval

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 12 00:58:14 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=163208

--- Comment #16 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 294533
  --> https://bugs.webkit.org/attachment.cgi?id=294533
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=294533&action=review

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2199
> +    dst = tempDestination(dst);

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

>>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2217
>>> +    instructions().append(localScopeDepth());
>> 
>> 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?
> 
> Ohh, not sure if I got how I can do this.

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161212/4b6a42a0/attachment.html>


More information about the webkit-unassigned mailing list