[webkit-changes] [WebKit/WebKit] dab2b1: [JSC] Implement `Iterator.from` from Iterator Hel...

SUZUKI Sosuke noreply at github.com
Sat Aug 31 00:01:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dab2b14ea3afc85a224fe7f83fe20938baeb0a60
      https://github.com/WebKit/WebKit/commit/dab2b14ea3afc85a224fe7f83fe20938baeb0a60
  Author: Sosuke Suzuki <aosukeke at gmail.com>
  Date:   2024-08-30 (Fri, 30 Aug 2024)

  Changed paths:
    A JSTests/stress/iterator-from.js
    M JSTests/test262/expectations.yaml
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/DerivedSources.make
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/builtins/BuiltinNames.h
    A Source/JavaScriptCore/builtins/JSIteratorConstructor.js
    A Source/JavaScriptCore/builtins/WrapForValidIteratorPrototype.js
    M Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
    M Source/JavaScriptCore/bytecode/LinkTimeConstant.h
    M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
    M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
    M Source/JavaScriptCore/heap/Heap.h
    M Source/JavaScriptCore/heap/HeapSubspaceTypes.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/JavaScriptCore/runtime/JSIteratorConstructor.cpp
    M Source/JavaScriptCore/runtime/JSIteratorConstructor.h
    M Source/JavaScriptCore/runtime/JSType.cpp
    M Source/JavaScriptCore/runtime/JSType.h
    A Source/JavaScriptCore/runtime/JSWrapForValidIterator.cpp
    A Source/JavaScriptCore/runtime/JSWrapForValidIterator.h
    A Source/JavaScriptCore/runtime/JSWrapForValidIteratorInlines.h
    A Source/JavaScriptCore/runtime/WrapForValidIteratorPrototype.cpp
    A Source/JavaScriptCore/runtime/WrapForValidIteratorPrototype.h
    A Source/JavaScriptCore/runtime/WrapForValidIteratorPrototypeInlines.h

  Log Message:
  -----------
   [JSC] Implement `Iterator.from` from Iterator Helpers Proposal
https://bugs.webkit.org/show_bug.cgi?id=278691

Reviewed by Yusuke Suzuki.

This patch implements `Iterator.from`[2][3] from the Iterator Helpers proposal[1].

[1]: https://github.com/tc39/proposal-iterator-helpers
[2]: https://github.com/tc39/proposal-iterator-helpers?tab=readme-ov-file#iteratorfromobject
[3]: https://tc39.es/proposal-iterator-helpers/#sec-iterator.from

* JSTests/stress/iterator-from.js: Added.
(assert):
(shouldThrow):
(throw.new.Error.Iter.prototype.next):
(throw.new.Error.Iter):
(throw.new.Error):
(sameValue):
(sameValue.Iter.prototype.return):
(sameValue.Iter):
(sameValue.Iter.prototype.next):
(sameValue.const.iter.get next):
(sameValue.const.iter.get return):
(sameValue.):
(sameValue.get const):
(string_appeared_here.shouldThrow):
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/builtins/JSIteratorConstructor.js: Added.
(linkTimeConstant.getIteratorDirect):
(linkTimeConstant.getIteratorFlattenable):
(from):
* Source/JavaScriptCore/builtins/WrapForValidIteratorPrototype.js: Added.
(next):
(return):
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitIsWrapForValidIterator):
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/heap/HeapSubspaceTypes.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::wrapForValidIteratorPrototype const):
(JSC::JSGlobalObject::wrapForValidIteratorStructure const):
* Source/JavaScriptCore/runtime/JSIteratorConstructor.cpp:
(JSC::JSIteratorConstructor::create):
(JSC::JSIteratorConstructor::finishCreation):
* Source/JavaScriptCore/runtime/JSIteratorConstructor.h:
* Source/JavaScriptCore/runtime/JSType.cpp:
(WTF::printInternal):
* Source/JavaScriptCore/runtime/JSType.h:
* Source/JavaScriptCore/runtime/JSWrapForValidIterator.cpp: Added.
(JSC::JSWrapForValidIterator::createWithInitialValues):
(JSC::JSWrapForValidIterator::finishCreation):
(JSC::JSWrapForValidIterator::visitChildrenImpl):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSWrapForValidIterator.h: Added.
* Source/JavaScriptCore/runtime/JSWrapForValidIteratorInlines.h:
(JSC::JSWrapForValidIterator::createStructure):
* Source/JavaScriptCore/runtime/WrapForValidIteratorPrototype.cpp:
(JSC::WrapForValidIteratorPrototype::finishCreation):
* Source/JavaScriptCore/runtime/WrapForValidIteratorPrototype.h:
* Source/JavaScriptCore/runtime/WrapForValidIteratorPrototypeInlines.h:
(JSC::WrapForValidIteratorPrototype::createStructure):

Canonical link: https://commits.webkit.org/283016@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list