⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Dec 22, 2019:

7:51 PM Changeset in webkit [253880] by Simon Fraser
  • 37 edits
    1 add
    2 deletes in trunk

LayoutTests/imported/w3c:
Very basic <dialog> show/close support
https://bugs.webkit.org/show_bug.cgi?id=205543

Reviewed by Antti Koivisto.

New results, some new passes.

  • web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/dialog-display-expected.txt:
  • web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/dialog-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-just-once-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-multiple-times-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-return-value-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt:
  • web-platform-tests/html/semantics/interactive-elements/the-dialog-element/show-modal-focusing-steps-expected.txt:
  • web-platform-tests/html/semantics/selectors/pseudo-classes/default-expected.txt:

Source/WebCore:
Very basic <dialog> show/close support
https://bugs.webkit.org/show_bug.cgi?id=205543

Reviewed by Antti Koivisto.

Fix HTMLDialogElement.idl for attribute reflection, and showModal() possibly throwing.

Have show/showModal() and close() toggle the "open" attribute. Implement parseAttribute()
to initialize m_isOpen from the attribute value.

Add dialog.css, which is appended to the UA stylesheets if the feature is enabled. Have
it set the display value.

Tested by web-platform-tests.

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • css/dialog.css: Added.

(dialog):
(dialog[open]):

  • html/HTMLDialogElement.cpp:

(WebCore::HTMLDialogElement::isOpen const):
(WebCore::HTMLDialogElement::show):
(WebCore::HTMLDialogElement::showModal):
(WebCore::HTMLDialogElement::close):
(WebCore::HTMLDialogElement::parseAttribute):
(WebCore::HTMLDialogElement::toggleOpen):
(WebCore::HTMLDialogElement::open): Deleted.
(WebCore::HTMLDialogElement::setOpen): Deleted.

  • html/HTMLDialogElement.h:
  • html/HTMLDialogElement.idl:
  • style/InspectorCSSOMWrappers.cpp:

(WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers):

  • style/UserAgentStyle.cpp:

(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):

  • style/UserAgentStyle.h:

Source/WebKit:
Make support for <dialog> an internal feature, off by default
https://bugs.webkit.org/show_bug.cgi?id=205542

Reviewed by Antti Koivisto.

Make DialogElementEnabled an internal feature so it shows up in the menus and
can be toggled on for experimentation.

  • Shared/WebPreferences.yaml:

LayoutTests:
Very basic <dialog> show/close support
https://bugs.webkit.org/show_bug.cgi?id=205543

Reviewed by Antti Koivisto.

  • imported/blink/dialog/element-removed-from-top-layer-has-original-position-expected.html: Removed.
  • imported/blink/dialog/element-removed-from-top-layer-has-original-position.html: Removed. The changes tested by this patch (added in r140075) were later removed,

then this test got re-imported from blink.

  • platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt:
  • platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml-expected.txt:
  • platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt:
7:51 PM Changeset in webkit [253879] by Simon Fraser
  • 2 edits in trunk/Source/WebKit

Make support for <dialog> an experimental feature, off by default
https://bugs.webkit.org/show_bug.cgi?id=205542

Reviewed by Dean Jackson.

Make DialogElementEnabled an experimental feature (off by default).

  • Shared/WebPreferences.yaml:
5:15 PM Changeset in webkit [253878] by Wenson Hsieh
  • 4 edits
    2 adds in trunk

[macCatalyst] Mouse clicks dispatch duplicate pointerup and pointerdown events
https://bugs.webkit.org/show_bug.cgi?id=205551
<rdar://problem/58058268>

Reviewed by Tim Horton.

Source/WebCore:

This began occuring after r251320, wherein some mouse event handling codepaths were enabled in macCatalyst.
For compatibility, gesture recognizers still fire in the macCatalyst platform. This includes the synthetic click
gesture, which will still synthesize and send mouseup and mousedown events to the page. After the change, this
results in pointer events being dispatched under the call to shouldIgnoreMouseEvent(). However, at the same
time, touch event handling codepaths have already dispatched "pointerup" and "pointerdown", so we end up with
redundant events.

To fix this macCatalyst-specific bug, simply avoid dispatching pointer events in the case where the synthetic
click type is some kind of tap gesture; in this case, pointer events have already been dispatched, so we don't
need to dispatch them again via mouse event handling code.

Test: pointerevents/ios/pointer-events-with-click-handler.html

  • dom/Element.cpp:

(WebCore::dispatchPointerEventIfNeeded):

Also rename shouldIgnoreMouseEvent to dispatchPointerEventIfNeeded to better reflect that this function's
primary purposee is to dispatch pointer events in response to platform mouse events; then, change the return
value to an explicit enum class indicating whether the mouse event should be subsequently ignored (as a result
of the page preventing the dispatched pointer event).

(WebCore::Element::dispatchMouseEvent):
(WebCore::shouldIgnoreMouseEvent): Deleted.

LayoutTests:

  • pointerevents/ios/pointer-events-with-click-handler-expected.txt: Added.
  • pointerevents/ios/pointer-events-with-click-handler.html: Added.

Add a layout test to verify that the bug does not occur. While this is a macCatalyst fix, this test needs to be
in the ios directory for now because macCatalyst is still considered "iOS family". This test is also still
relevant to both platforms (on iOS, synthesizing a tap behaves as expected, and in macCatalyst, it simulates a
click at the same location).

  • pointerevents/utils.js:

(EventTracker.prototype.assertMatchesEvents):
(EventTracker):

Drive-by fix: flip the order of arguments to assert_equals, so that when tests fail, the failure output
correctly shows how many events were expected, and how many were observed.

12:26 PM Changeset in webkit [253877] by Alan Coon
  • 8 edits in branches/safari-609.1.13-branch/Source

Versioning.

12:24 PM Changeset in webkit [253876] by ap@apple.com
  • 2 edits in trunk/LayoutTests

Add TextExpectations for flaky whlsl tests.

  • platform/mac/TestExpectations:
10:06 AM Changeset in webkit [253875] by Antti Koivisto
  • 8 edits in trunk/Source/WebCore

Invalidate only affected elements after media query evaluation changes
https://bugs.webkit.org/show_bug.cgi?id=205392

Reviewed by Zalan Bujtas.

We currently invalidate style of the whole tree when a media query evaluation changes.
We can do better by constructing an invalidation RuleSet and invalidating only those
elements that are potentially affected.

  • style/RuleSet.cpp:

(WebCore::Style::RuleSet::addRule):
(WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):

Construct and cache an invalidation RuleSet and associate with a set of media query changes.

(WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
(WebCore::Style::RuleSet::MediaQueryCollector::pop):
(WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):

Collect RuleFeatures which we later use to build invalidation RuleSet.

(WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.

  • style/RuleSet.h:

(WebCore::Style::DynamicMediaQueryEvaluationChanges::append):

  • style/StyleResolver.cpp:

(WebCore::Style::Resolver::evaluateDynamicMediaQueries):

  • style/StyleResolver.h:
  • style/StyleScope.cpp:

(WebCore::Style::Scope::evaluateMediaQueries):

Use the invalidation RuleSet for accurate style invalidation.

  • style/StyleScopeRuleSets.cpp:

(WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):

Collect invalidation RuleSets for author/user/user agent style.

  • style/StyleScopeRuleSets.h:
7:21 AM Changeset in webkit [253874] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][Integration] Do not remove trailing whitespace when it is followed by a line break
https://bugs.webkit.org/show_bug.cgi?id=205549
<rdar://problem/58139893>

Reviewed by Antti Koivisto.

Complex line layout quirk: keep the trailing whitespace aroun
when it is followed by a line break, unless the content overflows the line.

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::removeTrailingCollapsibleContent):

7:12 AM Changeset in webkit [253873] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][Integration] Do not collapse trailing letter spacing
https://bugs.webkit.org/show_bug.cgi?id=205548
<rdar://problem/58139872>

Reviewed by Antti Koivisto.

Turn off trailing letter-spacing trimming for now.

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::InlineItemRun::hasTrailingLetterSpacing const):

6:42 AM Changeset in webkit [253872] by youenn@apple.com
  • 7 edits
    2 copies in trunk/Source/ThirdParty/libwebrtc

Compile libwebrtc without hardware acceleration for iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=205491

Reviewed by Alex Christensen.

Use c routines instead of optimized versions for iOS simulator.

  • Configurations/libvpx.xcconfig:
  • Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h:
  • Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd_no_acceleration.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h.
  • Source/third_party/libvpx/source/config/mac/x64/vpx_config.h:
  • Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h:
  • Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd_no_acceleration.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h.
  • Source/third_party/libvpx/source/libvpx/vpx_ports/system_state.h:
  • libwebrtc.xcodeproj/project.pbxproj:
4:59 AM Changeset in webkit [253871] by eric.carlson@apple.com
  • 10 edits
    1 add in trunk/Source/WebKit

[Media in GPU process] Add remote media player proxy configuration
https://bugs.webkit.org/show_bug.cgi?id=205547
<rdar://problem/58139762>

Reviewed by Tim Horton.

  • GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:

(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):

  • GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
  • GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
  • GPUProcess/media/RemoteMediaPlayerProxy.cpp:

(WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::getConfiguration):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):

  • GPUProcess/media/RemoteMediaPlayerProxy.h:

(WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier):

  • GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: Added.

(WebKit::RemoteMediaPlayerProxyConfiguration::encode const):
(WebKit::RemoteMediaPlayerProxyConfiguration::decode):

  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:

(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
(WebKit::MediaPlayerPrivateRemote::engineDescription const):
(WebKit::MediaPlayerPrivateRemote::supportsScanning const):
(WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const):
(WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const):
(WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const):

  • WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
  • WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: Added.

(WebKit::RemoteMediaPlayerConfiguration::encode const):
(WebKit::RemoteMediaPlayerConfiguration::decode):

  • WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:

(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

4:10 AM Changeset in webkit [253870] by ysuzuki@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

Unreviewed, fix incorrect merging
https://bugs.webkit.org/show_bug.cgi?id=205327

r253862 and r253867 cause incorrect merging. This patch fixes it.

  • jit/ThunkGenerators.cpp:

(JSC::boundFunctionCallGenerator):

1:57 AM Changeset in webkit [253869] by ysuzuki@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

Unreviewed, fix debug failures due to missing exception checks
https://bugs.webkit.org/show_bug.cgi?id=205327

  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):

  • runtime/JSObject.cpp:

(JSC::JSObject::defineOwnNonIndexProperty):

Dec 21, 2019:

8:19 PM Changeset in webkit [253868] by BJ Burg
  • 44 edits
    4 copies
    5 adds in trunk/Source

Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
https://bugs.webkit.org/show_bug.cgi?id=205174
<rdar://problem/57887953>

Reviewed by Devin Rousso.

Source/WebCore:

Expose debuggable information via InspectorFrontendHost.

  • WebCore.xcodeproj/project.pbxproj: Add new files.
  • inspector/InspectorFrontendClient.h: Add new methods.
  • testing/Internals.cpp: Implement new methods.
  • inspector/InspectorFrontendHost.idl:
  • inspector/InspectorFrontendHost.h:
  • inspector/InspectorFrontendHost.cpp:

(WebCore::debuggableTypeToString):
(WebCore::InspectorFrontendHost::debuggableInfo const):
(WebCore::InspectorFrontendHost::debuggableType): Deleted.
Expose a DebuggableInfo dictionary via the .debuggableInfo getter.

Source/WebInspectorUI:

This change adds a new diagnostic recorder that reports information about
inspected targets and their type / version information.

  • UserInterface/Base/DebuggableType.js:

(WI.DebuggableType.fromString):
Move the static parsing factory method to DebuggableType class.

  • UserInterface/Main.html: Add new files.
  • UserInterface/Base/Main.js:

(WI.contentLoaded): Add new diagnostic recorder.

  • UserInterface/Protocol/InspectorBackend.js:

(InspectorBackendClass.prototype.activateDomain):
Adapt to InspectorFrontendHost changes.

  • UserInterface/Test/TestAppController.js:

(WI.TestAppController):

  • UserInterface/Controllers/AppController.js:

(WI.AppController):
Adapt to InspectorFrontendHost changes.

Source/WebKit:

This change supplies Web Inspector with information about the debuggable that
it is connected to. This is used for diagnostics and to customize the UI based
on the target type being inspected.

For remote Web Inspector, WebKit clients can populate an instance of
_WKInspectorDebuggableInfo and use it when calling into
-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:].

For local Web Inspector, WebInspectorProxy fills in information for the local
debuggable by consulting SystemVersion.plist (on Mac port).

The new enum _WKInspectorDebuggableType replaces _WKRemoteWebInspectorDebuggableType.
Its WebCore equivalent is Inspector::DebuggableType. The type and other information
are carried around in a _WKInspectorDebuggableInfo class. The equivalents for this
class are API::DebuggableInfo and DebuggableInfoData (for sending over IPC).

The DebuggableInfoData is sent as part of the initial message from UIProcess
to an Inspector WebProcess, similar to how a debuggableType string was sent before.

  • Sources.txt:
  • SourcesCocoa.txt:
  • WebKit.xcodeproj/project.pbxproj:

Add new files.

  • Shared/API/APIObject.h:
  • Shared/Cocoa/APIObject.mm:

(API::Object::newObject): Add new object type.

  • Shared/WebCoreArgumentCoders.h: Add EnumTraits for Inspector::DebuggableType.
  • UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h:
  • UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:

(legacyDebuggableTypeToModernDebuggableType):
(-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]):
(-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]):
(debuggableTypeString): Deleted.
Use the new enum in a new method that clients can switch over to. The old method
can be removed when it is no longer being used.

  • UIProcess/RemoteWebInspectorProxy.h:
  • UIProcess/RemoteWebInspectorProxy.cpp:

(WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy):
(WebKit::RemoteWebInspectorProxy::load):
(WebKit::RemoteWebInspectorProxy::reopen):
Send DebuggableInfoData struct to RemoteWebInspectorUI.

  • UIProcess/WebInspectorProxy.h:
  • UIProcess/WebInspectorProxy.cpp:

(WebKit::WebInspectorProxy::openLocalInspectorFrontend):
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
Send DebuggableInfoData struct to WebInspectorUI.

  • UIProcess/mac/WebInspectorProxyMac.mm:

(WebKit::systemVersionPlist):
(WebKit::WebInspectorProxy::infoForLocalDebuggable):
Add Mac implementation for local debuggables.

  • UIProcess/gtk/WebInspectorProxyGtk.cpp:

(WebKit::WebInspectorProxy::infoForLocalDebuggable):

  • UIProcess/win/WebInspectorProxyWin.cpp:

(WebKit::WebInspectorProxy::infoForLocalDebuggable):

  • UIProcess/wpe/WebInspectorProxyWPE.cpp:

(WebKit::WebInspectorProxy::infoForLocalDebuggable):
Add stubs for other platforms.

  • UIProcess/glib/RemoteInspectorClient.cpp:
  • UIProcess/socket/RemoteInspectorClient.h:
  • UIProcess/socket/RemoteInspectorClient.cpp:

(WebKit::RemoteInspectorClient::inspect):
(WebKit::debuggableTypeToString):
(WebKit::RemoteInspectorClient::setTargetList):
Use Inspector::DebuggableType instead of String for debuggable type.

  • WebProcess/WebPage/RemoteWebInspectorUI.messages.in:
  • WebProcess/WebPage/RemoteWebInspectorUI.h:
  • WebProcess/WebPage/RemoteWebInspectorUI.cpp:

(WebKit::RemoteWebInspectorUI::initialize):
(WebKit::RemoteWebInspectorUI::debuggableType const):
(WebKit::RemoteWebInspectorUI::targetPlatformName const):
(WebKit::RemoteWebInspectorUI::targetBuildVersion const):
(WebKit::RemoteWebInspectorUI::targetProductVersion const):
(WebKit::RemoteWebInspectorUI::targetIsSimulator const):
Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost.

  • WebProcess/WebPage/WebInspectorUI.messages.in:
  • WebProcess/WebPage/WebInspectorUI.h:
  • WebProcess/WebPage/WebInspectorUI.cpp:

(WebKit::WebInspectorUI::establishConnection):
(WebKit::WebInspectorUI::targetPlatformName const):
(WebKit::WebInspectorUI::targetBuildVersion const):
(WebKit::WebInspectorUI::targetProductVersion const):
Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost.

Source/WebKitLegacy/win:

  • WebCoreSupport/WebInspectorClient.h:
7:12 PM Changeset in webkit [253867] by ysuzuki@apple.com
  • 93 edits
    2 adds in trunk

[JSC] Improve our bound function implementation
https://bugs.webkit.org/show_bug.cgi?id=205327

Reviewed by Keith Miller.

JSTests:

  • microbenchmarks/function-bind-no-inlining-repeat-call.js: Added.

(assert):
(test):
(test2):
(foo):
(let.start.Date.now):

  • stress/bind-args.js: Added.

(shouldBe):
(test):
(test2):

Source/JavaScriptCore:

This patch improves Function#bind, and calling bound function with bound arguments.

  1. Rename CallFrameSlot::argumentCount to CallFrameSlot::argumentCountIncludingThis.
  2. Do not include name in NativeExecutable for JSBoundFunction. Putting name in NativeExecutable is assuming that function + name pair is almost identical. This is true in host functions except for JSBoundFunction. JSBoundFunction should hold its name in JSBoundFunction.
  3. Cache NativeExecutable for JSBoundFunction in the VM. We use a hash-map in JITThunk for NativeExecutables because we assume that host-function creation cannot be done by the user program: each executable is pre-defined to exactly one object by the environment, and there is no way to create host-functions repeatedly from the user-program. The only exception to this is JSBoundFunction so caching it on the VM avoids the hash-map lookup. This is not true for JSBoundFunction.
  4. ThunkGenerator should support JSBoundFunction call with bound arguments. It turns out that Speedometer2/React-Redux-TodoMVC is using bound function with bound arguments. Additionally, it is used. This is really bad: when dispatching an event, we first call this function from C++, entering JS world, going back to C++ world again, and entering JS world to call bound function again. By using ThunkGenerator, we can eliminate this back and forth by directly calling the bound JS Executable from the thunk. Previously, bound arguments are stored in JSArray. But it is difficult to access them from thunk since we need to consider have-a-bad-time case. Instead, we use JSImmutableButterfly to save bound arguments so that JIT thunk can quickly access arguments. To capture arguments as JSImmutableButterfly in JS world, we introduce op_create_arguments_butterfly, and handle it in all tiers.
  5. It turns out that eager materialization of "length" in JSBoundFunction takes long time while it is rarely used. This patch makes length lazily reified for JSBoundFunction.
  6. To make Function.prototype.bind faster, we track whether "name" and "length" properties of JSFunction is modified or not. This skips has-own-length-property check, which makes Function.prototype.bind 11~% faster.

Combining things above, creation of JSBoundFunction is 80~% faster. And calling bound function with bound arguments is 3~x faster.
This improves Speedometer2/React-TodoMVC by ~3%.

  • builtins/FunctionPrototype.js:

(bind):

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

  • bytecode/AccessCaseSnippetParams.cpp:

(JSC::SlowPathCallGeneratorWithArguments::generateImpl):

  • bytecode/BytecodeIntrinsicRegistry.h:
  • bytecode/BytecodeList.rb:
  • bytecode/BytecodeUseDef.cpp:

(JSC::computeUsesForBytecodeIndexImpl):
(JSC::computeDefsForBytecodeIndexImpl):

  • bytecode/VirtualRegister.cpp:

(JSC::VirtualRegister::dump const):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitCreateArgumentsButterfly):

  • bytecompiler/BytecodeGenerator.h:
  • bytecompiler/NodesCodegen.cpp:

(JSC::BytecodeIntrinsicNode::emit_intrinsic_createArgumentsButterfly):

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGArgumentsEliminationPhase.cpp:
  • dfg/DFGArgumentsUtilities.cpp:

(JSC::DFG::argumentsInvolveStackSlot):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::flushImpl):
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::isLiveInBytecode):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::forAllLocalsLiveInBytecode):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::emitStoreCallSiteIndex):

  • dfg/DFGNodeType.h:
  • dfg/DFGOSRAvailabilityAnalysisPhase.cpp:

(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::emitRestoreArguments):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::OSRExit::emitRestoreArguments):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPreciseLocalClobberize.h:

(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):

  • dfg/DFGPredictionPropagationPhase.cpp:
  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileCreateArgumentsButterfly):
(JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis):
(JSC::DFG::SpeculativeJIT::compileSetArgumentCountIncludingThis):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGStackLayoutPhase.cpp:

(JSC::DFG::StackLayoutPhase::run):

  • dfg/DFGStoreBarrierInsertionPhase.cpp:
  • ftl/FTLAbstractHeapRepository.h:
  • ftl/FTLCapabilities.cpp:

(JSC::FTL::canCompile):

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateArgumentsButterfly):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileSetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):

  • ftl/FTLSlowPathCall.h:

(JSC::FTL::callOperation):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::callSiteAsRawBits const):
(JSC::CallFrame::unsafeCallSiteAsRawBits const):
(JSC::CallFrame::setCurrentVPC):

  • interpreter/CallFrame.h:

(JSC::CallFrame::argumentCountIncludingThis const):
(JSC::CallFrame::setArgumentCountIncludingThis):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::jitAssertArgumentCountSane):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::argumentCount):

  • jit/CCallHelpers.h:

(JSC::CCallHelpers::prepareForTailCallSlow):

  • jit/CallFrameShuffler.cpp:

(JSC::CallFrameShuffler::dump const):
(JSC::CallFrameShuffler::prepareForTailCall):
(JSC::CallFrameShuffler::prepareAny):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::compileWithoutLinking):

  • jit/JITCall.cpp:

(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):

  • jit/JITInlines.h:

(JSC::JIT::updateTopCallFrame):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_argument_count):
(JSC::JIT::emit_op_get_rest_length):
(JSC::JIT::emit_op_get_argument):

  • jit/SetupVarargsFrame.cpp:

(JSC::emitSetupVarargsFrameFastCase):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::SpecializedThunkJIT):

  • jit/ThunkGenerators.cpp:

(JSC::arityFixupGenerator):
(JSC::boundFunctionCallGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator): Deleted.

  • jit/ThunkGenerators.h:
  • jsc.cpp:
  • llint/LLIntData.cpp:

(JSC::LLInt::Data::performAssertions):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • llint/WebAssembly.asm:
  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.h:
  • runtime/ExecutableBase.h:
  • runtime/FunctionRareData.cpp:

(JSC::FunctionRareData::FunctionRareData):

  • runtime/FunctionRareData.h:
  • runtime/IntlCollatorPrototype.cpp:

(JSC::IntlCollatorPrototypeGetterCompare):

  • runtime/IntlDateTimeFormatPrototype.cpp:

(JSC::IntlDateTimeFormatPrototypeGetterFormat):

  • runtime/IntlNumberFormatPrototype.cpp:

(JSC::IntlNumberFormatPrototypeGetterFormat):

  • runtime/Intrinsic.cpp:

(JSC::intrinsicName):

  • runtime/Intrinsic.h:
  • runtime/JSBoundFunction.cpp:

(JSC::boundThisNoArgsFunctionCall):
(JSC::boundFunctionCall):
(JSC::boundThisNoArgsFunctionConstruct):
(JSC::boundFunctionConstruct):
(JSC::JSBoundFunction::create):
(JSC::JSBoundFunction::JSBoundFunction):
(JSC::JSBoundFunction::boundArgsCopy):
(JSC::JSBoundFunction::visitChildren):

  • runtime/JSBoundFunction.h:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::finishCreation):
(JSC::JSFunction::name):
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::JSFunction::reifyLength):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded):
(JSC::JSFunction::reifyLazyBoundNameIfNeeded):

  • runtime/JSFunction.h:
  • runtime/JSFunctionInlines.h:

(JSC::JSFunction::areNameAndLengthOriginal):

  • runtime/JSGlobalObject.cpp:

(JSC::makeBoundFunction):
(JSC::hasOwnLengthProperty):

  • runtime/JSObject.h:

(JSC::getJSFunction):
(JSC::getCallData): Deleted.
(JSC::getConstructData): Deleted.

  • runtime/JSObjectInlines.h:

(JSC::getCallData):
(JSC::getConstructData):

  • runtime/VM.cpp:

(JSC::thunkGeneratorForIntrinsic):
(JSC::VM::getBoundFunction):

  • runtime/VM.h:
  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::wasmToJS):

  • wasm/js/WebAssemblyFunction.cpp:

(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

Tools:

Support running slow-microbenchmarks.

  • Scripts/run-jsc-benchmarks:

LayoutTests:

  • inspector/model/remote-object-get-properties-expected.txt:
  • inspector/runtime/getDisplayableProperties-expected.txt:
  • inspector/runtime/getProperties-expected.txt:
7:09 PM Changeset in webkit [253866] by eric.carlson@apple.com
  • 8 edits
    1 add in trunk/Source/WebKit

[Media in GPU process] Add remote media player configuration
https://bugs.webkit.org/show_bug.cgi?id=205541
<rdar://problem/58137418>

Reviewed by Simon Fraser.

  • GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:

(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):

  • GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
  • GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
  • GPUProcess/media/RemoteMediaPlayerProxy.cpp:

(WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
(WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):

  • GPUProcess/media/RemoteMediaPlayerProxy.h:

(WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier):

  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:

(WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

4:43 PM Changeset in webkit [253865] by Darin Adler
  • 31 edits in trunk/Source/JavaScriptCore

Make JSString values from literals in a single consistent style
https://bugs.webkit.org/show_bug.cgi?id=205517

Reviewed by Saam Barati.

Some call sites did it like this:

jsNontrivialString(vm, "literal"_s)

Others did it one of these:

jsString(vm, "literal")
jsNontrivialString(vm, "literal")

Changed all the call sites to do it the first, *slightly* more efficient, way.

  • runtime/ArrayIteratorPrototype.cpp:

(JSC::ArrayIteratorPrototype::finishCreation):

  • runtime/AsyncFunctionPrototype.cpp:

(JSC::AsyncFunctionPrototype::finishCreation):

  • runtime/AsyncGeneratorFunctionPrototype.cpp:

(JSC::AsyncGeneratorFunctionPrototype::finishCreation):

  • runtime/AsyncGeneratorPrototype.cpp:

(JSC::AsyncGeneratorPrototype::finishCreation):

  • runtime/BigIntPrototype.cpp:

(JSC::BigIntPrototype::finishCreation):

  • runtime/GeneratorFunctionPrototype.cpp:

(JSC::GeneratorFunctionPrototype::finishCreation):

  • runtime/GeneratorPrototype.cpp:

(JSC::GeneratorPrototype::finishCreation):

  • runtime/IntlCollatorPrototype.cpp:

(JSC::IntlCollatorPrototype::finishCreation):

  • runtime/IntlDateTimeFormat.cpp:

(JSC::IntlDateTimeFormat::formatToParts):

  • runtime/IntlDateTimeFormatPrototype.cpp:

(JSC::IntlDateTimeFormatPrototype::finishCreation):

  • runtime/IntlNumberFormat.cpp:

(JSC::IntlNumberFormat::formatToParts):

  • runtime/IntlNumberFormatPrototype.cpp:

(JSC::IntlNumberFormatPrototype::finishCreation):

  • runtime/IntlPluralRulesPrototype.cpp:

(JSC::IntlPluralRulesPrototype::finishCreation):

  • runtime/JSDataViewPrototype.cpp:

(JSC::JSDataViewPrototype::finishCreation):

  • runtime/JSModuleNamespaceObject.cpp:

(JSC::JSModuleNamespaceObject::finishCreation):

  • runtime/JSONObject.cpp:

(JSC::JSONObject::finishCreation):

  • runtime/JSPromisePrototype.cpp:

(JSC::JSPromisePrototype::finishCreation):

  • runtime/JSTypedArrayViewPrototype.cpp:

(JSC::typedArrayViewProtoGetterFuncToStringTag):

  • runtime/MapIteratorPrototype.cpp:

(JSC::MapIteratorPrototype::finishCreation):

  • runtime/MapPrototype.cpp:

(JSC::MapPrototype::finishCreation):

  • runtime/MathObject.cpp:

(JSC::MathObject::finishCreation):

  • runtime/RegExpPrototype.cpp:

(JSC::regExpProtoGetterSource):

  • runtime/RegExpStringIteratorPrototype.cpp:

(JSC::RegExpStringIteratorPrototype::finishCreation):

  • runtime/SetIteratorPrototype.cpp:

(JSC::SetIteratorPrototype::finishCreation):

  • runtime/SetPrototype.cpp:

(JSC::SetPrototype::finishCreation):

  • runtime/StringIteratorPrototype.cpp:

(JSC::StringIteratorPrototype::finishCreation):

  • runtime/SymbolPrototype.cpp:

(JSC::SymbolPrototype::finishCreation):

  • runtime/WeakMapPrototype.cpp:

(JSC::WeakMapPrototype::finishCreation):

  • runtime/WeakObjectRefPrototype.cpp:

(JSC::WeakObjectRefPrototype::finishCreation):

  • runtime/WeakSetPrototype.cpp:

(JSC::WeakSetPrototype::finishCreation):
Call jsNontrivialString instead of jsString and use the _s suffix.

9:18 AM Changeset in webkit [253864] by Antti Koivisto
  • 5 edits in trunk/Source

Move Vector HashTraits to HashTraits.h to fix GCC build
https://bugs.webkit.org/show_bug.cgi?id=205540

Reviewed by Zalan Bujtas.

Source/WebCore:

  • contentextensions/DFAMinimizer.cpp:

ActionKey HashTrait claims that emptyValueIsZero. Now with Vector HashTrait having emptyValueIsZero too
HashMap<ActionKey, Vector<>> started taking the optimized path.

However ActionKey empty value wasn't actually zero because Empty enum value wasn't 0.

Source/WTF:

GCC is stricter than LLVM with partial specializations

Error: partial specialization of struct WTF::HashTraits<WTF::Vector<U, otherCapacity, WTF::CrashOnOverflow, 16> >
after instantiation of struct WTF::HashTraits<WTF::Vector<WTF::String> >

  • wtf/HashTraits.h:
  • wtf/VectorHash.h:
6:58 AM Changeset in webkit [253863] by Kate Cheney
  • 19 edits in trunk

Add timeStamp to ITP database
https://bugs.webkit.org/show_bug.cgi?id=205121
<rdar://problem/57633021>

Reviewed by John Wilander.

Source/WebCore:

  • loader/ResourceLoadStatistics.h:

Source/WebKit:

This patch adds support for collecting most-recently-updated
timestamps for third-party/first-party domain pairs in the ITP database.
It updates the timestamp when new statistics are merged into the
database. It then exposes the timestamp via the
_getResourceLoadStatisticsDataSummary API.

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
Changed INSERT OR IGNORE queries to be INSERT OR REPLACE so the timestamp
will be replaced upon a new attempted insert into one of the
third-party/first-party relationship tables.
ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList now
checks for the keyword "REPLACE" to know if another bind is needed
to update the timestamp.

(WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp):
Queries the most recent time that the third party has appeared as a
subframe or subresource under the first party or redirected to the first party.

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
  • NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
  • NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:

(WebKit::ThirdPartyDataForSpecificFirstParty::toString const):
Updated the toString to check if the timestamp occured in the last
24 hours for testing purposes. It doesn't print the specific time
because it would change for every run and could not be tested.

  • UIProcess/API/Cocoa/WKWebsiteDataStore.mm:

(-[WKWebsiteDataStore _setUseITPDatabase:completionHandler:]):
Added new function that enables the ITP Database backend so the
timestamp parameter can be tested in in TestWebKitAPI.

  • UIProcess/API/APIResourceLoadStatisticsFirstParty.h:
  • UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
  • UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
  • UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm:

(-[_WKResourceLoadStatisticsFirstParty timeLastUpdated]):
Added the new timestamp parameter to the _WKResourceLoadStatisticsFirstParty.mm
class and its wrapper to be sent via API call.

Tools:

Added checks to test that the timestamp is properly exposed via API
in the ITP database backend. This also adds an API test case using the
ITP database store. It was previously only testing the ITP memory store.

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:

(TEST):

LayoutTests:

This patch updates test expectations which call
dumpResourceLoadStatistics to reflect the new timestamp parameter that
is now printed with the ITP data summary.

  • http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access-database-expected.txt:
  • http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access-expected.txt:
  • http/tests/storageAccess/aggregate-sorted-data-with-storage-access-database-expected.txt:
  • http/tests/storageAccess/aggregate-sorted-data-with-storage-access-expected.txt:
1:49 AM Changeset in webkit [253862] by ysuzuki@apple.com
  • 10 edits in trunk/Source/JavaScriptCore

[JSC] Remove m_globalObject field from JSFunction
https://bugs.webkit.org/show_bug.cgi?id=205533

Reviewed by Mark Lam.

JSFunction::m_globalObject is used only when it is using NativeExecutable.
And when using NativeExecutable, JSCallee::m_scope is always pointing JSGlobalObject.
This patch removes JSFunction::m_globalObject field.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):

  • ftl/FTLAbstractHeapRepository.h:
  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):

  • jit/ThunkGenerators.cpp:

(JSC::nativeForGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::JSFunction):

  • runtime/JSFunction.h:

(JSC::JSFunction::offsetOfGlobalObject): Deleted.
(JSC::JSFunction::globalObject const): Deleted.

  • runtime/JSFunctionInlines.h:

(JSC::JSFunction::JSFunction):

Note: See TracTimeline for information about the timeline view.