<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [JSC] Implement parsing of Async Functions"
href="https://bugs.webkit.org/show_bug.cgi?id=161409#c19">Comment # 19</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [JSC] Implement parsing of Async Functions"
href="https://bugs.webkit.org/show_bug.cgi?id=161409">bug 161409</a>
from <span class="vcard"><a class="email" href="mailto:utatane.tea@gmail.com" title="Yusuke Suzuki <utatane.tea@gmail.com>"> <span class="fn">Yusuke Suzuki</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=288384&action=diff" name="attach_288384" title="Patch">attachment 288384</a> <a href="attachment.cgi?id=288384&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=288384&action=review">https://bugs.webkit.org/attachment.cgi?id=288384&action=review</a>
Could you hide async / await parsing feature behind compile time / run time flag?
<span class="quote">> Source/JavaScriptCore/ChangeLog:7
> +</span >
Could you note ChangeLog?
<span class="quote">> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2980
> + ASSERT(func->metadata()->parseMode() == SourceParseMode::ArrowFunctionMode || func->metadata()->parseMode() == SourceParseMode::AsyncArrowFunctionMode);</span >
Let's use SourceParseModeSet here.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:264
> + if (parseMode == SourceParseMode::GeneratorBodyMode || isAsyncFunctionBodyParseMode(parseMode))</span >
Let's use SourceParseModeSet even if there is only one candidate. See the reason why <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - [JSC] implement async functions proposal"
href="show_bug.cgi?id=156147#c132">https://bugs.webkit.org/show_bug.cgi?id=156147#c132</a>.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:269
> + if (oneOfSourceParseModes<SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode>(parseMode) && !hasError()) {</span >
Could you change this oneOfSourceParseModes to one done in <a href="https://trac.webkit.org/changeset/201523">https://trac.webkit.org/changeset/201523</a> (SourceParseModeSet) ?
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:315
> + if (oneOfSourceParseModes<SourceParseMode::GeneratorWrapperFunctionMode>(parseMode) || isAsyncFunctionWrapperParseMode(parseMode)) {</span >
Ditto
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:559
> + info.parameterCount = 4; // generator, state, value, resume mode</span >
We no longer need this code since createGeneratorParameters automatically set info.parameterCount.
And keep in mind that the updated generator takes 5th argument, @generatorFrame.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:629
> + // FIXME: These branch causes 1% regression in octane code-load jquery.</span >
Since we already solved this, let's drop it.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:1748
> + // FIXME: These branch causes 1% regression in octane code-load jquery.</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:1946
> + RELEASE_ASSERT(!(oneOfSourceParseModes<SourceParseMode::ProgramMode, SourceParseMode::ModuleAnalyzeMode, SourceParseMode::ModuleEvaluateMode>(mode)));</span >
Ditto
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:1950
> + if (UNLIKELY((oneOfSourceParseModes<SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode>(mode)))) {</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:2086
> + if (UNLIKELY((oneOfSourceParseModes<SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode>(mode))))</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:2129
> + if (UNLIKELY((oneOfSourceParseModes<SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode>(mode)))) {</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:2179
> + if (!(functionDefinitionType == FunctionDefinitionType::Expression && oneOfSourceParseModes<SourceParseMode::NormalFunctionMode, SourceParseMode::AsyncFunctionMode>(mode)))</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:2294
> + RELEASE_ASSERT((oneOfSourceParseModes<SourceParseMode::NormalFunctionMode, SourceParseMode::MethodMode, SourceParseMode::ArrowFunctionMode, SourceParseMode::GeneratorBodyMode, SourceParseMode::GeneratorWrapperFunctionMode>(mode)) || isAsyncFunctionWrapperParseMode(mode));</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:2722
> + // FIXME: These branch causes 1% regression in octane code-load jquery.</span >
Since it is already solved, we can drop this FIXME.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:3353
> + // FIXME: These branch causes 1% regression in octane code-load jquery.</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:3512
> + return context.createYield(location, argument, delegate, divotStart, argumentStart, lastTokenEndPosition());</span >
How about using AwaitNode here and emit the similar code in code generation phase?
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:4117
> + // FIXME: These branch causes 1% regression in octane code-load jquery.</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:76
> +static ALWAYS_INLINE bool oneOfSourceParseModes(SourceParseMode mode)</span >
Change to SourceParseModeSet version.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:83
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:100
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:110
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:117
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:125
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:132
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:142
> + return oneOfSourceParseModes<</span >
Ditto.
<span class="quote">> Source/JavaScriptCore/parser/ParserModes.h:149
> + return oneOfSourceParseModes<SourceParseMode::ProgramMode>(parseMode);</span >
Ditto.</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>