[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
Sun Jan 15 12:56:23 PST 2017


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

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

This LGTM, I think it's just about ready to land,  just a few remaining comments.

> Source/JavaScriptCore/bytecode/BytecodeList.json:157
> +            { "name" : "op_resolve_closest_var_scope", "length" : 4 }

I have a naming suggestion for this bytecode (and the various functions & DFG node for it)
Instead of calling it "resolve_closest_var_scope", we should maybe call it:
"resolve_closest_or_var_scope" since the intention is to do a normal scope walk, but stop if we see a var scope. The objective is not to *always* stop at the closest var scope.

> Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm:-2115
> -


> Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:-2068
> -


> Source/JavaScriptCore/parser/Parser.h:639
> +                    addResult.iterator->value.setIsFunction();

I don't think this is strictly true here.
Is this needed?

> Source/JavaScriptCore/runtime/JSScope.cpp:219
> +JSObject* JSScope::resolveClosestVar(ExecState* exec, JSScope* scope, const Identifier& ident)

This function is almost identical to the below resolve. Maybe you can combine them by defining a common function that takes some kind of shouldStopEarly lambda? And just make that function ALWAYS_INLINE.

> Source/JavaScriptCore/runtime/JSScope.cpp:231
> +            JSScope* globalScopeExtension = scope->globalObject(vm)->globalScopeExtension();

Do you know what this is? We should have a test for this if it's easily doable.

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/20170115/aa5eb6d5/attachment.html>

More information about the webkit-unassigned mailing list