Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b89710391cb5e6695d92f6dc06cd8ac4973a7355
      
https://github.com/WebKit/WebKit/commit/b89710391cb5e6695d92f6dc06cd8ac4973a7355
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-06-28 (Sun, 28 Jun 2026)

  Changed paths:
    A JSTests/stress/map-set-iterator-next-entries-double-fixup-exit-ok.js
    A JSTests/stress/map-set-iterator-next-intrinsic.js
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/DerivedSources-input.xcfilelist
    M Source/JavaScriptCore/DerivedSources.make
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/builtins/BuiltinNames.h
    R Source/JavaScriptCore/builtins/MapIteratorPrototype.js
    R Source/JavaScriptCore/builtins/SetIteratorPrototype.js
    M Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp
    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/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/runtime/Intrinsic.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSMapIterator.cpp
    M Source/JavaScriptCore/runtime/JSMapIterator.h
    M Source/JavaScriptCore/runtime/JSSetIterator.cpp
    M Source/JavaScriptCore/runtime/JSSetIterator.h
    M Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp
    M Source/JavaScriptCore/runtime/SetIteratorPrototype.cpp

  Log Message:
  -----------
  [JSC] Map/Set iterator next function should be in C++
https://bugs.webkit.org/show_bug.cgi?id=317285
rdar://179901173

Reviewed by Yijia Huang.

This patch implements MapIterator#next / SetIterator#next in C++. So we
also add intrinsic support in DFG so that we can move them to C++ while
still supporting inlining in DFG / FTL. We also remove many helper
functions which are only used to implement MapIterator#next /
SetIterator#next in builtin JS.

Test: JSTests/stress/map-set-iterator-next-intrinsic.js

* JSTests/stress/map-set-iterator-next-entries-double-fixup-exit-ok.js: Added.
(shouldBe):
(sumMapEntries):
* JSTests/stress/map-set-iterator-next-intrinsic.js: Added.
(shouldBe):
(shouldThrow):
(sumMapKeys):
(sumMapValues):
(stepShapesMap):
(nextEmpty):
(callMapNextWithBadThis):
(callSetNextWithBadThis):
(set var):
(set shouldBe):
(set add):
(mixed):
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/DerivedSources-input.xcfilelist:
* Source/JavaScriptCore/DerivedSources.make:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/builtins/MapIteratorPrototype.js: Removed.
* Source/JavaScriptCore/builtins/SetIteratorPrototype.js: Removed.
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitIsArrayIterator):
(JSC::BytecodeGenerator::emitIsMapIterator): Deleted.
(JSC::BytecodeGenerator::emitIsSetIterator): Deleted.
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::mapIteratorInternalFieldIndex): Deleted.
(JSC::setIteratorInternalFieldIndex): Deleted.
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getMapIteratorInternalField): 
Deleted.
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getSetIteratorInternalField): 
Deleted.
(JSC::BytecodeIntrinsicNode::emit_intrinsic_putMapIteratorInternalField): 
Deleted.
(JSC::BytecodeIntrinsicNode::emit_intrinsic_putSetIteratorInternalField): 
Deleted.
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/runtime/Intrinsic.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSMapIterator.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION): Deleted.
* Source/JavaScriptCore/runtime/JSMapIterator.h:
* Source/JavaScriptCore/runtime/JSSetIterator.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION): Deleted.
* Source/JavaScriptCore/runtime/JSSetIterator.h:
* Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototype::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototype::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):

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



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

Reply via email to