[ESNext] Async iteration - Implement Async Generator - optimization
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Sep 2017 15:05:53 +0000 (15:05 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Sep 2017 15:05:53 +0000 (15:05 +0000)
commit99060fe7030ed85bcc41574e19807f3b887a6386
treeaecd5260d16b44ff425e75afedb3ceebcee8cfe4
parent0aed89412802ac067f50476bd12d9f7659425257
[ESNext] Async iteration - Implement Async Generator - optimization
https://bugs.webkit.org/show_bug.cgi?id=175891

Reviewed by Yusuke Suzuki.

Add small optimization for async generators:
1. merging async generator queue to async generator itself
generator.@first / generator.@last is enough, by doing so,
  we remove one unnecessary object alloc.
2. merging request with queue.

* builtins/AsyncGeneratorPrototype.js:
(globalPrivate.asyncGeneratorQueueIsEmpty):
(globalPrivate.asyncGeneratorQueueCreateItem):
(globalPrivate.asyncGeneratorQueueEnqueue):
(globalPrivate.asyncGeneratorQueueDequeue):
(globalPrivate.asyncGeneratorDequeue):
(globalPrivate.isSuspendYieldState):
(globalPrivate.asyncGeneratorEnqueue):
* builtins/BuiltinNames.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPutAsyncGeneratorFields):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionNode::emitBytecode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js
Source/JavaScriptCore/builtins/BuiltinNames.h
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp