Speculatively change iteration protocall to use the same next function
https://bugs.webkit.org/show_bug.cgi?id=175653
Reviewed by Saam Barati.
JSTests:
Change test to match the new iteration behavior.
* stress/spread-optimized-properly.js:
Source/JavaScriptCore:
This patch speculatively makes a change to the iteration protocall to fetch the next
property immediately after calling the Symbol.iterator function. This is, in theory,
a breaking change, so we will see if this breaks things (most likely it won't as this
is a relatively subtle point).
See: https://github.com/tc39/ecma262/issues/976
* builtins/IteratorHelpers.js:
(performIteration):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::emitIteratorNext):
(JSC::BytecodeGenerator::emitIteratorNextWithValue):
(JSC::BytecodeGenerator::emitDelegateYield):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayPatternNode::bindValue const):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::iteratorEntries):
* runtime/IteratorOperations.cpp:
(JSC::iteratorNext):
(JSC::iteratorStep):
(JSC::iteratorClose):
(JSC::iteratorForIterable):
* runtime/IteratorOperations.h:
(JSC::forEachInIterable):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
LayoutTests:
Change test to match the new iteration behavior.
* js/sequence-iterator-protocol-2-expected.txt:
* js/sequence-iterator-protocol-2.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222421
268f45cc-cd09-0410-ab3c-
d52691b4dbfc