Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 092eccdd01d2d8ef6a437024d3a9ba099b00c18f
      
https://github.com/WebKit/WebKit/commit/092eccdd01d2d8ef6a437024d3a9ba099b00c18f
  Author: Elliott Williams <[email protected]>
  Date:   2026-08-12 (Wed, 12 Aug 2026)

  Changed paths:
    M Source/WebKit/PlatformCocoa.cmake
    M Source/WebKit/SwiftPrewarmMac.swift
    M Source/cmake/OptionsCocoa.cmake
    M Source/cmake/WebKitMacros.cmake
    M Source/cmake/WebKitSwiftPrewarm.cmake
    M Tools/TestWebKitAPI/PlatformCocoa.cmake

  Log Message:
  -----------
  [CMake] Prewarmed modules not cached when compiling WebKit
https://bugs.webkit.org/show_bug.cgi?id=321533
rdar://183370889

Reviewed by Geoffrey Garen.

The prewarm target was missing some necessary definition and search path
flags needed to produce the same module cache key. This meant that it
wasn't prewarming at all, and WebKit's swift task was rebuilding all
modules downstream of wtf. The performance impact worsened when
317797@main added modulemaps for JavaScriptCore_Private and WebCore.

Fix by doing more work in WEBKIT_ADD_SWIFT_PREWARM to discover compiler
flags. Also add the new modules we produce to our prewarm target. On an
M5 Max, this is about a 1% (5 sec) progression.

Verified that the modules are no longer being built twice by capturing
the swift driver invocation and re-running with `-v` to show -emit-pcm
commands. Confirmed that the command for WebKit does not build any
modules upstream of WebKit itself:

    set swiftc_webkit (ninja -t commands Source/WebKit/WebKit.swiftmodule | 
tail -1)
    set swiftc_prewarm (ninja -t commands 
Source/WebKit/SwiftPrewarmMac.swiftmodule | tail -1)
    eval $swiftc_prewarm -v | grep -o '\-emit-pcm.*-module-name [A-Za-z_]*'
    eval $swiftc_webkit -v | grep -o '\-emit-pcm.*-module-name [A-Za-z_]*'

As a drive-by, refactor how `-explicit-module-builds` is passed to
remove duplication and apply it more consistently across the codebase.

* Source/WebKit/PlatformCocoa.cmake:
* Source/WebKit/SwiftPrewarmMac.swift:
* Source/cmake/OptionsCocoa.cmake:
* Source/cmake/WebKitMacros.cmake:
* Source/cmake/WebKitSwiftPrewarm.cmake:
* Tools/TestWebKitAPI/PlatformCocoa.cmake:

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



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

Reply via email to