[Webkit-unassigned] [Bug 166695] [ESNext] Async iteration - Implement Async Generator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 8 06:28:45 PST 2017


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

--- Comment #39 from Caitlin Potter (:caitp) <caitp at igalia.com> ---
Comment on attachment 300609
  --> https://bugs.webkit.org/attachment.cgi?id=300609
Patch

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

I've left a few runtime comments, but I do understand that this patch does not claim to implement the runtime perfectly.

> Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js:90
> +        generator. at asyncGeneratorResumePromise.@then(

I believe it's observable to implement the queue this way --- AsyncGeneratorResolve and AsyncGeneratorReject immediately begin resuming subsequent requests if the queue is not empty, but this waits until a later turn. I think this could cause weird races between implementations which match the spec and implementations which do this.

Maybe Domenic can indicate if this is the intent or not

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:686
> +    bool needTryCatch = isAsyncFunctionOrAsyncGeneratorWrapperParseMode(parseMode) && !isSimpleParameterList;

async generators don't need a try/catch for the parameter list, they just throw synchronously if parameters cause problems (https://tc39.github.io/proposal-async-iteration/#sec-asyncgenerator-definitions-evaluatebody), and do not return a Promise

> Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp:142
> +    enum class Kind { Escaped, Object, Activation, Function, GeneratorFunction, AsyncFunction, AsyncGeneratorFunction };

I think I would personally prefer it if DFG/FTL passes were untouched in the initial patch, but I suppose that will be left up to reviewers.

> Source/JavaScriptCore/parser/Parser.h:261
> +            setIsGenerator();

This stuff is getting very complicated, I feel there has to be a better way to track function scope types. I feel this is very error prone.

-- 
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/20170208/b5d08546/attachment.html>


More information about the webkit-unassigned mailing list