Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a1cb5e087a461a8ff468d49e85897349a175a2dd
https://github.com/WebKit/WebKit/commit/a1cb5e087a461a8ff468d49e85897349a175a2dd
Author: Yusuke Suzuki <[email protected]>
Date: 2025-09-28 (Sun, 28 Sep 2025)
Changed paths:
M
JSTests/stress/destructuring-assignment-require-object-coercible-symbol-private.js
M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
M Source/JavaScriptCore/Sources.txt
M Source/JavaScriptCore/builtins/BuiltinNames.h
M Source/JavaScriptCore/builtins/PromiseOperations.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/dfg/DFGByteCodeParser.cpp
M Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.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/ftl/FTLOperations.cpp
M Source/JavaScriptCore/heap/Heap.cpp
M Source/JavaScriptCore/heap/Heap.h
M Source/JavaScriptCore/interpreter/Interpreter.cpp
M Source/JavaScriptCore/runtime/Intrinsic.h
M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.h
A Source/JavaScriptCore/runtime/JSPromiseReaction.cpp
A Source/JavaScriptCore/runtime/JSPromiseReaction.h
M Source/JavaScriptCore/runtime/JSType.cpp
M Source/JavaScriptCore/runtime/JSType.h
Log Message:
-----------
[JSC] Introduce JSPromiseReaction object
https://bugs.webkit.org/show_bug.cgi?id=299707
rdar://161528913
Reviewed by Sosuke Suzuki.
This patch introduces JSPromiseReaction object. This is the first step
for cleaning up our Promise implementation mainly focusing on improving
JetStream3/doxbee-promise.
1. We simplify our reaction mechanism. Previously we were using
array-likes, but in most of cases (1) user do not set multiple
reactions to the same promise and (2) array tends to allocate more
memory due to 2x resizing. So let's just use single-linked list of
JSPromiseReaction.
2. JSPromiseReaction is internal JSObject, which has fixed slots
accessible from JS side as well. Also DFG / FTL optimized allocation
is set up.
3. Change of @pushNewPromiseReaction made @performPromiseThen bytecode
size increased. And we observed large performance regression in
JetStream3/doxbee-promise due to this. We annotate @performPromiseThen
with @alwaysInline not to introduce this performance regression.
*
JSTests/stress/destructuring-assignment-require-object-coercible-symbol-private.js:
(throw.new.Error):
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/builtins/PromiseOperations.js:
(linkTimeConstant.triggerPromiseReactions):
(linkTimeConstant.promiseResolveThenableJobFast):
(linkTimeConstant.promiseResolveThenableJobWithoutPromiseFast):
(linkTimeConstant.alwaysInline.performPromiseThen):
(linkTimeConstant.pushNewPromiseReaction): Deleted.
(linkTimeConstant.performPromiseThen): Deleted.
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitIsPromiseReaction):
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::promiseReactionInternalFieldIndex):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getPromiseReactionInternalField):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_putPromiseReactionInternalField):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp:
* 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::compileNewInternalFieldObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* Source/JavaScriptCore/ftl/FTLOperations.cpp:
(JSC::FTL::JSC_DEFINE_NOEXCEPT_JIT_OPERATION):
* Source/JavaScriptCore/heap/Heap.cpp:
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::Interpreter::getAsyncStackTrace):
* Source/JavaScriptCore/runtime/Intrinsic.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::promiseReactionStructure const):
* Source/JavaScriptCore/runtime/JSPromiseReaction.cpp: Added.
(JSC::JSPromiseReaction::createWithInitialValues):
(JSC::JSPromiseReaction::create):
(JSC::JSPromiseReaction::visitChildrenImpl):
(JSC::JSPromiseReaction::createStructure):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSPromiseReaction.h: Added.
* Source/JavaScriptCore/runtime/JSType.cpp:
(WTF::printInternal):
* Source/JavaScriptCore/runtime/JSType.h:
Canonical link: https://commits.webkit.org/300670@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes