Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 938197ba0c7f2f15c4fcb26a06c114781cac216e
      
https://github.com/WebKit/WebKit/commit/938197ba0c7f2f15c4fcb26a06c114781cac216e
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-10-11 (Sat, 11 Oct 2025)

  Changed paths:
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/builtins/BuiltinNames.h
    M Source/JavaScriptCore/builtins/PromiseConstructor.js
    M Source/JavaScriptCore/builtins/PromiseOperations.js
    M Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
    M Source/JavaScriptCore/bytecode/LinkTimeConstant.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/JSCast.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/JavaScriptCore/runtime/JSPromise.cpp
    M Source/JavaScriptCore/runtime/JSPromiseAllContext.cpp
    M Source/JavaScriptCore/runtime/JSPromiseAllContext.h
    A Source/JavaScriptCore/runtime/JSPromiseAllGlobalContext.cpp
    A Source/JavaScriptCore/runtime/JSPromiseAllGlobalContext.h
    M Source/JavaScriptCore/runtime/JSType.cpp
    M Source/JavaScriptCore/runtime/JSType.h

  Log Message:
  -----------
  [JSC] Add JSPromiseAllGlobalContext
https://bugs.webkit.org/show_bug.cgi?id=300546
rdar://162417712

Reviewed by Sosuke Suzuki.

We found that Promise.all function is kept in Baseline JIT in some
critical benchmarks, which makes us think we should move this eventually
to native code to

1. make JSPromiseAllContext & JSPromiseAllGlobalContext cells more
   efficient
2. make early start-up time execution faster (e.g. Speedometer3)

This patch introduces JSPromiseAllGlobalContext to make Promise.all more
efficient for GC. This shares `values` & `remainingElementsCount` for
Promise.all so that sizeof(JSPromiseAllContext) gets shrunk, which will
be allocated per promise, so much more costly for GC.

* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/builtins/PromiseConstructor.js:
(linkTimeConstant.promiseAllNewResolveElement):
(all):
(linkTimeConstant.promiseOnRejectedWithContext): Deleted.
(linkTimeConstant.promiseAllOnFulfilled): Deleted.
* Source/JavaScriptCore/builtins/PromiseOperations.js:
(linkTimeConstant.promiseRejectSlow):
(linkTimeConstant.promiseEmptyOnFulfilled): Deleted.
(linkTimeConstant.promiseEmptyOnRejected): Deleted.
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::promiseAllContextInternalFieldIndex):
(JSC::promiseAllGlobalContextInternalFieldIndex):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_getPromiseAllGlobalContextInternalField):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_putPromiseAllGlobalContextInternalField):
* 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/JSCast.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::promiseAllGlobalContextStructure const):
* Source/JavaScriptCore/runtime/JSPromise.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSPromiseAllContext.cpp:
(JSC::JSPromiseAllContext::createWithInitialValues):
(JSC::JSPromiseAllContext::create):
(JSC::JSPromiseAllContext::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSPromiseAllContext.h:
* Source/JavaScriptCore/runtime/JSPromiseAllGlobalContext.cpp: Copied from 
Source/JavaScriptCore/runtime/JSPromiseAllContext.cpp.
(JSC::JSPromiseAllGlobalContext::createWithInitialValues):
(JSC::JSPromiseAllGlobalContext::create):
(JSC::JSPromiseAllGlobalContext::finishCreation):
(JSC::JSPromiseAllGlobalContext::visitChildrenImpl):
(JSC::JSPromiseAllGlobalContext::createStructure):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSPromiseAllGlobalContext.h: Copied from 
Source/JavaScriptCore/runtime/JSPromiseAllContext.h.
* Source/JavaScriptCore/runtime/JSType.cpp:
(WTF::printInternal):
* Source/JavaScriptCore/runtime/JSType.h:

Canonical link: https://commits.webkit.org/301371@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

Reply via email to