[Webkit-unassigned] [Bug 156147] [JSC] implement async functions proposal

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 12 08:59:26 PDT 2016


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

--- Comment #80 from Yusuke Suzuki <utatane.tea at gmail.com> ---
Comment on attachment 278692
  --> https://bugs.webkit.org/attachment.cgi?id=278692
Patch

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

Nice clean up! Sorry for my late review process. I have a time on week end :)

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:245
> +    bool containsArrowOrEvalButNotInArrowBlock = ((functionNode->usesArrowFunction() && functionNode->doAnyInnerArrowFunctionsUseAnyFeature()) || functionNode->usesEval()) && (!m_codeBlock->isArrowFunction() && !m_codeBlock->isAsyncArrowFunction());

Now, isArrowFunction() includes isAsyncArrowFunction, let's drop isAsyncArrowFunction. :)

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:249
> +    bool needsArguments = (functionNode->usesArguments() || codeBlock->usesEval() || (functionNode->usesArrowFunction() && !codeBlock->isArrowFunction() && !codeBlock->isAsyncArrowFunction() && isArgumentsUsedInInnerArrowFunction()));

Ditto.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:509
> +        if (!haveParameterNamedArguments && !m_codeBlock->isArrowFunction() && !m_codeBlock->isAsyncArrowFunction()) {

isAsyncArrowFunction is included in isArrowFunction().

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:630
> +    if (SourceParseMode::ArrowFunctionMode == parseMode || SourceParseMode::AsyncArrowFunctionBodyMode == parseMode || SourceParseMode::AsyncArrowFunctionMode == parseMode) {

Is this AsyncArrowFunctionBodyMode correct?

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:638
> +    if (needsToUpdateArrowFunctionContext() && !codeBlock->isArrowFunction() && !codeBlock->isAsyncArrowFunction()) {

isAsyncArrowFunction is included in isArrowFunction()

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4313
> +    ASSERT(m_codeBlock->isArrowFunction() || parseMode() == SourceParseMode::AsyncArrowFunctionBodyMode || parseMode() == SourceParseMode::AsyncArrowFunctionMode || m_codeBlock->isArrowFunctionContext() || constructorKind() == ConstructorKind::Derived || m_codeType == EvalCode);

Is this `SourceParseMode::AsyncArrowFunctionBodyMode` correct?

> Source/JavaScriptCore/parser/ASTBuilder.h:386
> +            usesArrowFunction();

Is this usesArrowFunction() here correct?

> Source/JavaScriptCore/parser/Parser.cpp:3562
> +            goto parseProperty;

Is it safe for `async hello: value` property?

> Source/JavaScriptCore/parser/Parser.cpp:3989
> +            return parseAsyncFunctionExpression(context);

Looks nice.

> Source/JavaScriptCore/parser/Parser.h:1579
> +        ASSERT(false);

Let's use `RELEASE_ASSERT_NOT_REACHED()`

> Source/JavaScriptCore/runtime/CodeCache.cpp:200
> +    ConstructAbility constructAbility = constructAbilityForParseMode(metadata->parseMode());

Nice.

-- 
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/20160512/ddc3cbeb/attachment.html>


More information about the webkit-unassigned mailing list