Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5e28b6ce22ee4fccd38c23498a469f3d8508a47a
https://github.com/WebKit/WebKit/commit/5e28b6ce22ee4fccd38c23498a469f3d8508a47a
Author: Yusuke Suzuki <[email protected]>
Date: 2026-07-24 (Fri, 24 Jul 2026)
Changed paths:
A JSTests/microbenchmarks/async-generator-yield-star.js
A JSTests/stress/async-iteration-yield-star-resume-value.js
M Source/JavaScriptCore/bytecode/BytecodeList.rb
M Source/JavaScriptCore/bytecode/BytecodeOperandsForCheckpoint.h
M Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp
M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
M Source/JavaScriptCore/dfg/DFGOperations.cpp
M Source/JavaScriptCore/dfg/DFGOperations.h
M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
M Source/JavaScriptCore/jit/JITCall.cpp
M Source/JavaScriptCore/jit/JITOperations.cpp
M Source/JavaScriptCore/jit/JITOperations.h
M Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
M Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
M Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
M Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.cpp
M Source/JavaScriptCore/runtime/JSAsyncFromSyncIterator.h
M Source/JavaScriptCore/runtime/JSMicrotask.cpp
M Source/JavaScriptCore/runtime/JSMicrotask.h
Log Message:
-----------
[JSC] Use op_async_iterator_open and op_async_iterator_next for yield*
https://bugs.webkit.org/show_bug.cgi?id=319946
rdar://182862712
Reviewed by Yijia Huang.
This patch applies op_async_iterator_open and op_async_iterator_next to
yield* in async generator functions. Previously we cannot apply that
since op_async_iterator_next was always calling `next()` while yield*
will pass a resume value `next(resumeValue)`. This patch extends
op_async_iterator_next to have a flag "hasValue", and based on that
argument will be pushed or not.
ToT Patched
async-generator-yield-star 95.7791+-0.6264 ^ 79.6243+-0.7356
^ definitely 1.2029x faster
Tests: JSTests/microbenchmarks/async-generator-yield-star.js
JSTests/stress/async-iteration-yield-star-resume-value.js
* JSTests/microbenchmarks/async-generator-yield-star.js: Added.
(async createAsyncGen):
(async run):
* JSTests/stress/async-iteration-yield-star-resume-value.js: Added.
(assert):
(async driverPath.async inner):
(async driverPath.async outer):
(async driverPath):
(async genericPath):
(async genericPath.async outer):
(async forAwaitZeroArgs):
(async asyncFromSyncPath):
(async asyncFromSyncPath.async outer):
(async asyncFromSyncPath.async outerArr):
(async main):
* Source/JavaScriptCore/bytecode/BytecodeList.rb:
* Source/JavaScriptCore/bytecode/BytecodeOperandsForCheckpoint.h:
(JSC::argumentCountIncludingThisFor):
(JSC::resumeValueOperandFor):
* Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp:
(JSC::computeUsesForBytecodeIndexImpl):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGetGenericAsyncIterator):
(JSC::BytecodeGenerator::emitAsyncIteratorNext):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::emitDelegateYield):
(JSC::BytecodeGenerator::emitGetAsyncIterator): Deleted.
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleAsyncIteratorNext):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* Source/JavaScriptCore/jit/JITCall.cpp:
(JSC::JIT::emit_op_async_iterator_next):
* Source/JavaScriptCore/jit/JITOperations.cpp:
(JSC::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/jit/JITOperations.h:
* Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm:
* Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:
* Source/JavaScriptCore/runtime/AsyncFromSyncIteratorPrototype.cpp:
(JSC::driveAsyncFromSyncIteratorWithDriver):
* Source/JavaScriptCore/runtime/JSAsyncFromSyncIterator.h:
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::resumeValueOrUndefined):
(JSC::enqueueAsyncGeneratorDriver):
(JSC::asyncIteratorNextWithDriver):
* Source/JavaScriptCore/runtime/JSMicrotask.h:
Canonical link: https://commits.webkit.org/317906@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications