Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4a94df609677f41c3f143808334498ed53850e81
      
https://github.com/WebKit/WebKit/commit/4a94df609677f41c3f143808334498ed53850e81
  Author: Ryan Reno <[email protected]>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M Source/WTF/wtf/Assertions.h
    M Source/WTF/wtf/HashTable.h
    M Source/WTF/wtf/Ref.h
    M Source/WTF/wtf/RefPtr.h
    M Source/WTF/wtf/TypeCasts.h
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestAsyncIterable.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestAsyncIterableWithoutFlags.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestAsyncKeyValueIterable.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestConditional.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestConditionalIncludes.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSON.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONCustomGetter.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDomainSecurity.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestEmbedderArrayLike.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestEnabledForContext.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestExceptionSubclass.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestMapLike.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestOperationConditional.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestScheduledAction.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestSetLike.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestTaggedWrapper.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

  Log Message:
  -----------
  Reduce binary size resulting from large strings generated by RELEASE_ASSERTs 
in template functions.
https://bugs.webkit.org/show_bug.cgi?id=322851
rdar://186093511

Reviewed by Alexey Proskuryakov.

RELEASE_ASSERT uses __PRETTY_FUNCTION__ to label the crash site with the 
function name. In template functions
this string is the full template instantiation which can be very costly in 
terms of binary size.

This change replaces __PRETTY_FUNCTION__ with __func__ via a new macro which is 
a much more simplified, unqualified name. This saves us quite a
bit of binary size in the static c string table. Measured reductions to the c 
string table in the frameworks on macOS (non-LTO release build) are:

WebCore:        -59%
WebKit:         -69%
JSC:            -43%
WebKitLegacy:   -35%

This is an overall ~2.8MB binary size reduction on macOS. We should not expect 
a runtime memory footprint reduction
since this memory won't be dirtied but we will see this reduction in size on 
disk.

No tests as there's no behavior change.

* Source/WTF/wtf/Assertions.h:
* Source/WTF/wtf/HashTable.h:
(WTF::HashTable::validateKey):
* Source/WTF/wtf/Ref.h:
(WTF::downcast):
* Source/WTF/wtf/RefPtr.h:
(WTF::downcast):
* Source/WTF/wtf/TypeCasts.h:
(WTF::downcast):
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp:
        Changes to various output test files to reflect the use of the new 
macro.

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



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

Reply via email to