[webkit-changes] [WebKit/WebKit] a587e9: [GLIB] Garden some coop failures

2023-01-29 Thread Lauro Moura
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a587e9d2899acb3d24aa479555a5a84e6bbcc260
  
https://github.com/WebKit/WebKit/commit/a587e9d2899acb3d24aa479555a5a84e6bbcc260
  Author: Lauro Moura 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M LayoutTests/platform/glib/TestExpectations
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-unsafe-none.https_5-6-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-unsafe-none.https_7-8-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-unsafe-none-to-unsafe-none.https_5-6-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-unsafe-none-to-unsafe-none.https_7-8-expected.txt
R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_0-1-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_2-3-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_4-5-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_6-7-expected.txt
A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_8-last-expected.txt
M LayoutTests/platform/gtk/TestExpectations

  Log Message:
  ---
  [GLIB] Garden some coop failures

Unreviewed test gardening.

* LayoutTests/platform/glib/TestExpectations:
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-unsafe-none.https_5-6-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-unsafe-none.https_7-8-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-unsafe-none-to-unsafe-none.https_5-6-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/iframe-popup-unsafe-none-to-unsafe-none.https_7-8-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_0-1-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_2-3-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_4-5-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_6-7-expected.txt:
 Added.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https_8-last-expected.txt:
 Added.
* LayoutTests/platform/gtk/TestExpectations:

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 076b5a: [ANGLE] Fix -Wsign-compare warnings on watchOS

2023-01-29 Thread Commit Queue
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 076b5adb1937cf7b5f7ea2ac7b6629e0792a493b
  
https://github.com/WebKit/WebKit/commit/076b5adb1937cf7b5f7ea2ac7b6629e0792a493b
  Author: David Kilzer 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/ThirdParty/ANGLE/Configurations/Base.xcconfig
M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm
M Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm

  Log Message:
  ---
  [ANGLE] Fix -Wsign-compare warnings on watchOS
https://bugs.webkit.org/show_bug.cgi?id=250684


Reviewed by Kimmo Kinnunen.

On watchOS, 'GLintptr' and 'ptrdiff_t' are defined as signed
types, so they must be converted to an unsigned value to compare
them to std::numeric_limits::max().

In general, this code treats signed variables as containers for
unsigned values, so checking for negative values isn't important
in this context.  Instead overflow only needs to be checked
before casting if the signed type is larger than uint32_t.

* Source/ThirdParty/ANGLE/Configurations/Base.xcconfig:
(WK_FIXME_WARNING_CFLAGS): Remove -Wno-sign-compare.

* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm:
(rx::FramebufferMtl::readPixelsToPBO const):
- Only check for overflow if the size of
  `packPixelsParams.offset` (ptrdiff_t) is larger than the size
  of uint32_t.
- Use static_cast>() when checking for
  overflow of `packPixelsParams.offset`.

* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm:
(rx::VertexArrayMtl::convertVertexBufferGPU):
- Extract `binding.getOffset()` into a local variable.
- Only check for overflow if the size of `bindingOffset`
  (GLintptr) is larger than the size of uint32_t.
- Use static_cast>() when checking for
  overflow of `bindingOffset`.
- Add an overflow check for `vertexConversion->offset` since
  it's a size_t value, and switch to std::min() from MIN().

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 313974: Add support to allow lookalike characters on sanit...

2023-01-29 Thread Charlie Wolfe
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 313974e6d6608538daaf50e5f52e29b55f3c7dc7
  
https://github.com/WebKit/WebKit/commit/313974e6d6608538daaf50e5f52e29b55f3c7dc7
  Author: Charlie Wolfe 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/dom/Document.cpp
M Source/WebCore/page/ChromeClient.h
A Source/WebCore/page/LookalikeCharactersSanitizationData.h
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebKit/Platform/cocoa/NetworkConnectionIntegrityHelpers.h
M Source/WebKit/Shared/WebPageCreationParameters.cpp
M Source/WebKit/Shared/WebPageCreationParameters.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in

  Log Message:
  ---
  Add support to allow lookalike characters on sanitization
https://bugs.webkit.org/show_bug.cgi?id=250992
rdar://103329323

Reviewed by Wenson Hsieh.

Add the functionality to allow certain lookalike characters on sanitization when
accessed from bindings. See below for more details.

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::adjustedURL const):
(WebCore::Document::urlForBindings const):

Refactor returning the adjusted URL such that we request the sanitized URL
with the allowed lookalike characters.

* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::allowedLookalikeCharacters const):

Add a client function to sanitize a given URL.

* Source/WebCore/page/LookalikeCharactersSanitizationData.h: Copied from 
Source/WebKit/Platform/cocoa/NetworkConnectionIntegrityHelpers.h.
(WebCore::LookalikeCharactersSanitizationData::LookalikeCharactersSanitizationData):
(WebCore::LookalikeCharactersSanitizationData::lookalikeCharacters):
(WebCore::LookalikeCharactersSanitizationData::encode const):
(WebCore::LookalikeCharactersSanitizationData::decode):

Add a struct to hold data used for domain scoped lookalike character 
sanitization.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::allowedLookalikeCharacters const):
* Source/WebCore/page/Page.h:

Add helper functions on Page to sanitize a given URL.

* Source/WebKit/Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Source/WebKit/Shared/WebPageCreationParameters.h:

Add the allowed lookalike character strings to the web page creation 
parameters. This
is used to retrieve the cached allowed lookalike characters in the UI process.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::cachedAllowedLookalikeStrings):
(WebKit::WebPageProxy::updateAllowedLookalikeCharacterStringsIfNeeded):
* Source/WebKit/UIProcess/WebPageProxy.h:

Add functionality to update the allowed lookalike characters strings in 
`didCommitLoadForFrame`.
This previously existed for `cachedLookalikeStrings`, but was changed because 
the lookalike strings
were populated too late to apply for this first navigation within a web view. 
Since `allowedLookalikeStrings`
only needs to be populated after a navigation has already occured, we can have 
the update function in
`didCommitLoadForFrame`.

* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::allowedLookalikeCharacters const):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:

* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::allowedLookalikeCharacters):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_appHighlightsVisible):
(WebKit::WebPage::setAllowedLookalikeCharacterStrings):

Populate the allowed lookalike character strings hashmap as domain -> 
lookalikeCharacters.

* Source/WebKit/WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::allowedLookalikeCharacters):
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 11b19e: [IFC][initial letter] Enable initial-letter for IFC

2023-01-29 Thread Alan Baradlay
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 11b19e8902086dabd5bb009d659e84c3ee1f7a33
  
https://github.com/WebKit/WebKit/commit/11b19e8902086dabd5bb009d659e84c3ee1f7a33
  Author: Alan Baradlay 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
M Source/WebCore/layout/integration/LayoutIntegrationCoverage.h

  Log Message:
  ---
  [IFC][initial letter] Enable initial-letter for IFC
https://bugs.webkit.org/show_bug.cgi?id=250306

Reviewed by Antti Koivisto.

* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForStyle):
* Source/WebCore/layout/integration/LayoutIntegrationCoverage.h:

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 16a66f: [WebGPU] GPUTexture::destroy() and RemoteDevicePro...

2023-01-29 Thread Myles C. Maxfield
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 16a66f7561b54ca47761eabaea1b6ddbfa5e03ae
  
https://github.com/WebKit/WebKit/commit/16a66f7561b54ca47761eabaea1b6ddbfa5e03ae
  Author: Myles C. Maxfield 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WebCore/Modules/WebGPU/GPUTexture.cpp
M Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp

  Log Message:
  ---
  [WebGPU] GPUTexture::destroy() and RemoteDeviceProxy::destroy() do nothing
https://bugs.webkit.org/show_bug.cgi?id=251326
rdar://104786514

Reviewed by Tadeu Zagallo.

We must have just forgotten to hook them up. All the other destroy() methods 
are already hooked up.

* Source/WebCore/Modules/WebGPU/GPUTexture.cpp:
(WebCore::GPUTexture::destroy):
* Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp:
(WebKit::WebGPU::RemoteDeviceProxy::destroy):

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 766d0e: Optimize CSS images by caching StyleImages when po...

2023-01-29 Thread Sam Weinig
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 766d0eca343b7fd0ca5f29ab89e12bdd4c531244
  
https://github.com/WebKit/WebKit/commit/766d0eca343b7fd0ca5f29ab89e12bdd4c531244
  Author: Sam Weinig 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WebCore/css/CSSCanvasValue.cpp
M Source/WebCore/css/CSSCanvasValue.h
M Source/WebCore/css/CSSFilterImageValue.cpp
M Source/WebCore/css/CSSGradientValue.cpp
M Source/WebCore/css/CSSGradientValue.h
M Source/WebCore/css/CSSNamedImageValue.cpp
M Source/WebCore/css/CSSNamedImageValue.h

  Log Message:
  ---
  Optimize CSS images by caching StyleImages when possible
https://bugs.webkit.org/show_bug.cgi?id=251162
rdar://104654181

Reviewed by Antti Koivisto.

Add caching of StyleImages in CSSValue classes to avoid
duplicate processing and allocation where possible. This
is a pretty conservative pass of caching opertunities,
further opertunities may be available.

The largest optimization here is for CSS gradients, where
by caching the StyleGradientImage, we can avoid recomputing
color stops in many cases.

* Source/WebCore/css/CSSCanvasValue.cpp:
(WebCore::CSSCanvasValue::createStyleImage const):
* Source/WebCore/css/CSSCanvasValue.h:
* Source/WebCore/css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::createStyleImage const):
(WebCore::CSSPrefixedLinearGradientValue::createStyleImage const):
(WebCore::CSSDeprecatedLinearGradientValue::createStyleImage const):
(WebCore::CSSRadialGradientValue::createStyleImage const):
(WebCore::CSSPrefixedRadialGradientValue::createStyleImage const):
(WebCore::CSSDeprecatedRadialGradientValue::createStyleImage const):
(WebCore::CSSConicGradientValue::createStyleImage const):
* Source/WebCore/css/CSSGradientValue.h:
* Source/WebCore/css/CSSNamedImageValue.cpp:
* Source/WebCore/css/CSSNamedImageValue.h:

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] df25b4: Hairline on selection when bidi text is involved

2023-01-29 Thread Alan Baradlay
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: df25b495844dd7ecb0314c4c42c318088bf0c863
  
https://github.com/WebKit/WebKit/commit/df25b495844dd7ecb0314c4c42c318088bf0c863
  Author: Alan Baradlay 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
A LayoutTests/fast/repaint/rtl-content-selection-hairline-gap-expected.txt
A LayoutTests/fast/repaint/rtl-content-selection-hairline-gap.html
M Source/WebCore/rendering/TextBoxPainter.cpp

  Log Message:
  ---
  Hairline on selection when bidi text is involved
https://bugs.webkit.org/show_bug.cgi?id=220548


Reviewed by Antti Koivisto.

Due to webkit.org/b/251318, we may compute a slightly shorter selection rect 
for non-whitespace runs with soft wrap opportunities between them.
Such shrunk selection rects produce hairline gap at inline box boundaries.

* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintBackground): we've got _visual_ 
values here (at least with ignoring writing-mode), no need for directional 
pixel snapping.

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 8f8d02: AX: WebCore::AXIsolatedTree should use WTF::Thread...

2023-01-29 Thread AndresGonzalezApple
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f8d02ddc94ec040493c25ae6526472f60739dde
  
https://github.com/WebKit/WebKit/commit/8f8d02ddc94ec040493c25ae6526472f60739dde
  Author: Andres Gonzalez 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WebCore/accessibility/AXObjectCache.cpp
M Source/WebCore/accessibility/AXTextMarker.cpp
M Source/WebCore/accessibility/AXTreeStore.h
M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h

  Log Message:
  ---
  AX: WebCore::AXIsolatedTree should use 
WTF::ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<>.
https://bugs.webkit.org/show_bug.cgi?id=251223
rdar://104512153

Reviewed by Alex Christensen.

AXIsolatedTree now derives from ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr 
instead of ThreadSafeRefCounted and CanMakeWeakPtr, which was a problem since 
WeakPtr is not thread safe.
In order to have a single AXTreeStore that keeps both WeakPtr 
and ThreadSafeWeakPtr, we added the variant AXTreePtr. Note 
that WeakPtr does not have to be thread safe since AXObjectCache 
is only used on the main thread.

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 91955d: [GTK][WPE] Bring back WebKitConsoleMessage API imp...

2023-01-29 Thread Carlos Garcia Campos
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91955d0ab066432662bddfc48d7d6b9388aec222
  
https://github.com/WebKit/WebKit/commit/91955d0ab066432662bddfc48d7d6b9388aec222
  Author: Carlos Garcia Campos 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp
A Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp
M Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp
M Tools/TestWebKitAPI/glib/CMakeLists.txt

  Log Message:
  ---
  [GTK][WPE] Bring back WebKitConsoleMessage API implementation
https://bugs.webkit.org/show_bug.cgi?id=251315

Reviewed by Michael Catanzaro.

I deprecated the API in 257010@main and removed the functionality
assuming nobody was actually using it, but I was wrong. So, keep the API
deprecated, but bring back the implementation for backwards
compatibility.

* Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkitWebPageDidSendConsoleMessage):
(webkit_web_page_class_init):
(webkitWebPageCreate):
* Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp: Added.
(ConsoleMessageTest::ConsoleMessage::operator== const):
(ConsoleMessageTest::consoleMessageReceivedCallback):
(ConsoleMessageTest::ConsoleMessageTest):
(ConsoleMessageTest::~ConsoleMessageTest):
(ConsoleMessageTest::waitUntilConsoleMessageReceived):
(testWebKitConsoleMessageConsoleAPI):
(testWebKitConsoleMessageJavaScriptException):
(testWebKitConsoleMessageNetworkError):
(testWebKitConsoleMessageSecurityError):
(beforeAll):
(afterAll):
* Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(consoleMessageSentCallback):
(pageCreatedCallback):
* Tools/TestWebKitAPI/glib/CMakeLists.txt:

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] 2a2d8e: [JSC] Remove "Embedder" word from wasm implementation

2023-01-29 Thread Yusuke Suzuki
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a2d8e7054ea7f27f6add48499fae4ea0968acb4
  
https://github.com/WebKit/WebKit/commit/2a2d8e7054ea7f27f6add48499fae4ea0968acb4
  Author: Yusuke Suzuki 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/JavaScriptCore/CMakeLists.txt
M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
M Source/JavaScriptCore/Sources.txt
M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
M Source/JavaScriptCore/wasm/WasmB3IRGenerator.h
M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
M Source/JavaScriptCore/wasm/WasmBBQPlan.h
M Source/JavaScriptCore/wasm/WasmCallee.cpp
M Source/JavaScriptCore/wasm/WasmCallee.h
M Source/JavaScriptCore/wasm/WasmCalleeGroup.cpp
M Source/JavaScriptCore/wasm/WasmCalleeGroup.h
M Source/JavaScriptCore/wasm/WasmCompilationMode.cpp
M Source/JavaScriptCore/wasm/WasmCompilationMode.h
R Source/JavaScriptCore/wasm/WasmEmbedder.h
M Source/JavaScriptCore/wasm/WasmInstance.cpp
M Source/JavaScriptCore/wasm/WasmInstance.h
A Source/JavaScriptCore/wasm/WasmJS.h
M Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
M Source/JavaScriptCore/wasm/WasmLLIntPlan.h
M Source/JavaScriptCore/wasm/WasmModule.h
M Source/JavaScriptCore/wasm/WasmPlan.h
M Source/JavaScriptCore/wasm/WasmTable.h
M Source/JavaScriptCore/wasm/WasmThunks.h
M Source/JavaScriptCore/wasm/js/WasmToJS.h
M Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp

  Log Message:
  ---
  [JSC] Remove "Embedder" word from wasm implementation
https://bugs.webkit.org/show_bug.cgi?id=251331
rdar://104791730

Reviewed by Mark Lam.

JSC Wasm implementation's embedder is always JS, and we are not planning to 
change it.
We should tightly couple our wasm implementation with the rest of JSC to make 
it super efficient and fast.
This patch removes "Embedder" word from wasm implementation. Replacing them 
with "JS".

* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::AirIRGeneratorBase):
(JSC::Wasm::ExpressionType>::addCall):
(JSC::Wasm::ExpressionType>::addCallIndirect):
(JSC::Wasm::ExpressionType>::addCallRef):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::B3IRGenerator::addCallRef):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.h:
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunction):
(JSC::Wasm::BBQPlan::didCompleteCompilation):
(JSC::Wasm::BBQPlan::initializeCallees):
* Source/JavaScriptCore/wasm/WasmBBQPlan.h:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::runWithDowncast):
* Source/JavaScriptCore/wasm/WasmCallee.h:
* Source/JavaScriptCore/wasm/WasmCalleeGroup.cpp:
(JSC::Wasm::CalleeGroup::CalleeGroup):
* Source/JavaScriptCore/wasm/WasmCalleeGroup.h:
* Source/JavaScriptCore/wasm/WasmCompilationMode.cpp:
(JSC::Wasm::makeString):
* Source/JavaScriptCore/wasm/WasmCompilationMode.h:
(JSC::Wasm::isOSREntry):
(JSC::Wasm::isAnyBBQ):
(JSC::Wasm::isAnyOMG):
* Source/JavaScriptCore/wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::initElementSegment):
* Source/JavaScriptCore/wasm/WasmInstance.h:
* Source/JavaScriptCore/wasm/WasmJS.h: Renamed from 
Source/JavaScriptCore/wasm/WasmEmbedder.h.
* Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp:
(JSC::Wasm::LLIntPlan::didCompleteCompilation):
* Source/JavaScriptCore/wasm/WasmLLIntPlan.h:
* Source/JavaScriptCore/wasm/WasmModule.h:
* Source/JavaScriptCore/wasm/WasmPlan.h:
* Source/JavaScriptCore/wasm/WasmTable.h:
* Source/JavaScriptCore/wasm/WasmThunks.h:
* Source/JavaScriptCore/wasm/js/WasmToJS.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::initializeExports):

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [WebKit/WebKit] ac6109: [JSC] Optimize Number constructor calls further

2023-01-29 Thread Yusuke Suzuki
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac61096b73818052b6035da906ac29f54a80ec93
  
https://github.com/WebKit/WebKit/commit/ac61096b73818052b6035da906ac29f54a80ec93
  Author: Yusuke Suzuki 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
A JSTests/microbenchmarks/number-on-string.js
M Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
M Source/JavaScriptCore/dfg/DFGClobberize.h
M Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
M Source/JavaScriptCore/dfg/DFGOperations.cpp
M Source/JavaScriptCore/dfg/DFGOperations.h
M Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
M Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
M Source/JavaScriptCore/jit/JSInterfaceJIT.h
M Source/JavaScriptCore/jit/SpecializedThunkJIT.h
M Source/JavaScriptCore/jit/ThunkGenerators.cpp
M Source/JavaScriptCore/jit/ThunkGenerators.h
M Source/JavaScriptCore/runtime/Intrinsic.h
M Source/JavaScriptCore/runtime/JSCJSValueInlines.h
M Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
M Source/JavaScriptCore/runtime/NumberConstructor.cpp
M Source/JavaScriptCore/runtime/NumberConstructor.h
M Source/JavaScriptCore/runtime/VM.cpp

  Log Message:
  ---
  [JSC] Optimize Number constructor calls further
https://bugs.webkit.org/show_bug.cgi?id=251309
rdar://104773086

Reviewed by Mark Lam.

It turned out that Number constructor call is super heavily used for two 
purposes,

1. To make String -> Number
2. To ensure the given input is Number. It is very frequently already a number.
3. To make BigInt -> Number

And this constructor is called even from LLInt etc. frequently.

We were using InternalFunction for NumberConstructor. On the other hand, 
JSFunction is
the fastest form for calls. The tradeoff is that, InternalFunction does not 
generate
a new JIT code, and it is great for a function which takes enough amount of 
time in C++
side, in this case, allocations! That's why we typically use InternalFunction 
for builtin
constructors. However, Number constructor can be used for just a call to 
convert an input
to a number, and in this case, C++ time is sufficiently small, and we care the 
performance
of calls itself. So, in this patch,

1. We change NumberConstructor from InternalFunction-based to JSFunction-based. 
Old days,
   probably, this is not supported. But to make JSPromiseConstructor work well, 
we already
   made it work. So let's do it, and make NumberConstructor call super fast.
2. We add NumberConstructorIntrinsic and add a thunk which returns quickly if 
an input is
   a number. This sufficiently covers a lot of cases in the wild.
3. We handle NumberConstructor calls onto String efficiently, and add DFG / FTL 
optimizations
   for that pattern.

Number constructor calls for String gets 20% faster on Baseline-only case 
(because of
InternalFunction -> JSFunction change). And we got 2x faster performance on FTL.

DFG disabled.
 ToT Patched

number-on-string   19.1253+-0.1344 ^ 15.6378+-0.1594^ 
definitely 1.2230x faster

DFG and FTL enabled.
 ToT Patched

number-on-string9.1768+-0.0289 ^  4.6237+-0.0249^ 
definitely 1.9847x faster

* JSTests/microbenchmarks/number-on-string.js: Added.
(shouldBe):
(test):
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter::executeEffects):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleCallVariant):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::ByteCodeParser::handleTypedArrayConstructor):
(JSC::DFG::ByteCodeParser::handleConstantFunction):
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction): Deleted.
* Source/JavaScriptCore/dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupToNumberOrToNumericOrCallNumberConstructor):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToNumber):
* Source/JavaScriptCore/jit/JSInterfaceJIT.h:
(JSC::JSInterfaceJIT::emitLoadJSValue):
* Source/JavaScriptCore/jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::loadJSArgument):
(JSC::SpecializedThunkJIT::returnJSValue):
* 

[webkit-changes] [WebKit/WebKit] 226272: Unify pal/spi/cocoa/IOSurfaceSPI.h and wtf/spi/coc...

2023-01-29 Thread Myles C. Maxfield
  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 226272d257aa13931871a1afae3228934d82309d
  
https://github.com/WebKit/WebKit/commit/226272d257aa13931871a1afae3228934d82309d
  Author: Myles C. Maxfield 
  Date:   2023-01-29 (Sun, 29 Jan 2023)

  Changed paths:
M Source/WTF/WTF.xcodeproj/project.pbxproj
A Source/WTF/wtf/spi/cocoa/IOReturnSPI.h
M Source/WTF/wtf/spi/cocoa/IOSurfaceSPI.h
A Source/WTF/wtf/spi/cocoa/IOTypesSPI.h
M Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
M Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h
M Source/WebCore/PAL/pal/spi/cocoa/IOPMLibSPI.h
R Source/WebCore/PAL/pal/spi/cocoa/IOReturnSPI.h
R Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h
R Source/WebCore/PAL/pal/spi/cocoa/IOTypesSPI.h
M Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h
M Source/WebCore/platform/graphics/cocoa/IOSurface.h
M Source/WebCore/platform/graphics/cv/GraphicsContextGLCVCocoa.cpp
M Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm
M Source/WebCore/platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp
M Source/WebGPU/WebGPU/PresentationContextIOSurface.mm
M Source/WebKit/Shared/cg/ShareableBitmapCG.cpp
M 
Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp

  Log Message:
  ---
  Unify pal/spi/cocoa/IOSurfaceSPI.h and wtf/spi/cocoa/IOSurfaceSPI.h
https://bugs.webkit.org/show_bug.cgi?id=251323


Reviewed by Tim Horton.

No reason to have 2 separate files that contain different contents.

* Source/WTF/wtf/spi/cocoa/IOSurfaceSPI.h:
* Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj:
* Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h:
* Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h: Removed.
* Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h:
* Source/WebCore/platform/graphics/cocoa/IOSurface.h:
* Source/WebCore/platform/graphics/cv/GraphicsContextGLCVCocoa.cpp:
* Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm:
* Source/WebCore/platform/mediastream/cocoa/DisplayCaptureSourceCocoa.cpp:
* Source/WebKit/Shared/cg/ShareableBitmapCG.cpp:
* 
Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp:

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


___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes