[webkit-changes] [WebKit/WebKit] 776f5f: [JSC] Restore liveness based interference analysis...

mattwoodrow noreply at github.com
Fri Apr 7 17:54:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 776f5f1ac40f7cb8e7034e6a1e0470c2087af141
      https://github.com/WebKit/WebKit/commit/776f5f1ac40f7cb8e7034e6a1e0470c2087af141
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp
    M Source/JavaScriptCore/dfg/DFGAvailabilityMap.h
    M Source/JavaScriptCore/dfg/DFGForAllKills.h

  Log Message:
  -----------
  [JSC] Restore liveness based interference analysis too
https://bugs.webkit.org/show_bug.cgi?id=252798
rdar://problem/105818549

Reviewed by Ryan Haddad and Michael Saboff.

This is partial revert of https://commits.webkit.org/259548.47@safari-7615-branch.
While the above change fixed the global interference problem, we have a problem.

1. We would like to check interference on all the live place since OSR exit may need to restore
   phantomized candidate nodes.
2. If PutStack / GetStack happens in the basic block and the stack state gets incorrect in the
   middle of basic block, we cannot know.

    loc0 => @b
    PutStack loc0 @a
    ...
    OSR exit
    ...
    PutStack loc0 @b
    ...
    loc0 => @b

So we partially revert the change in https://commits.webkit.org/259548.47@safari-7615-branch,

1. First collect all stack modification. And record which part of stack is modified for each basic block unit.
2. Then, for each basic block
    2.1. If this basic block does not have stack modification, then just check availability for live candidates availability
         this head. Since this basic block does not have stack modification, this basic block itself never incurs interference.
         Only thing we need to check is that now the live nodes are already clobbered in terms of availability because the
         successors modified the stack.
    2.2. If this basic block does stack modification, let's take live candidates at the tail of basic block and check whether
         the basic block is clobbering this candidate's relying stack. If so, remove it from candidate.
    2.3. For each newly killed DFG node at a node-index in this basic block, check (2.2)'s stack modification and remove it
         from candidate if its stack is modified.

This added part is effectively the code removed in https://commits.webkit.org/259548.47@safari-7615-branch (so, existing code before).
Compared to the old behavior, 2.1 is added newly to cover inter-block handling.

* Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp:
* Source/JavaScriptCore/dfg/DFGAvailabilityMap.h:
(JSC::DFG::AvailabilityMap::forEachAvailability const):
(JSC::DFG::AvailabilityMap::closeOverNodes const):
(JSC::DFG::AvailabilityMap::closeStartingWithLocal const):
(JSC::DFG::AvailabilityMap::forEachAvailability): Deleted.
(JSC::DFG::AvailabilityMap::closeOverNodes): Deleted.
(JSC::DFG::AvailabilityMap::closeStartingWithLocal): Deleted.

Cherry-pick: 259548.275 at safari-7615-branch (b022d8caf560). rdar://107709855
Canonical link: https://commits.webkit.org/262738@main


  Commit: 36c30e42e64c37712540d2bb161372a17e2ad686
      https://github.com/WebKit/WebKit/commit/36c30e42e64c37712540d2bb161372a17e2ad686
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    M Source/ThirdParty/libwebrtc/Source/third_party/libaom/source/libaom/av1/encoder/encodeframe_utils.c

  Log Message:
  -----------
  Cherry-pick aom 3154860bdbe978da9271ba55eea60973b0be06b5
https://bugs.webkit.org/show_bug.cgi?id=253015
rdar://105507028

Reviewed by Geoffrey Garen.

Cherry-pick patch from upstream.

* Source/ThirdParty/libwebrtc/Source/third_party/libaom/source/libaom/av1/encoder/encodeframe_utils.c:
(av1_source_content_sb):

Cherry-pick: 259548.317 at safari-7615-branch (92bb5fbd72e5). rdar://107755462
Canonical link: https://commits.webkit.org/262739@main


  Commit: 38d36c5fe33e52c5538107cf2ec3c292fa667726
      https://github.com/WebKit/WebKit/commit/38d36c5fe33e52c5538107cf2ec3c292fa667726
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    M Source/WebCore/html/OffscreenCanvas.cpp

  Log Message:
  -----------
  Disable main-thread WebGL in OffscreenCanvas.
https://bugs.webkit.org/show_bug.cgi?id=253267
<rdar://105684718>

Reviewed by Simon Fraser.

* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::shouldEnableWebGL):

Cherry-pick: 259548.355 at safari-7615-branch (630b1e2aa50f). rdar://107755518
Canonical link: https://commits.webkit.org/262740@main


  Commit: 171dfb71ff1d63e3153fdaad184979bd8df50f17
      https://github.com/WebKit/WebKit/commit/171dfb71ff1d63e3153fdaad184979bd8df50f17
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    A LayoutTests/fast/canvas/offscreen-disabled-construct3-quirk-expected.txt
    A LayoutTests/fast/canvas/offscreen-disabled-construct3-quirk.html
    M Source/WebCore/bindings/js/JSLocalDOMWindowCustom.cpp

  Log Message:
  -----------
  OffscreenCanvas support without WebGL breaks Construct 3 content.
https://bugs.webkit.org/show_bug.cgi?id=253431
<rdar://106341361>

Reviewed by Chris Dumez.

Construct 3 is testing for the presence of OffscreenCanvas on the main thread, and then assumes
that a WebGL context will be able to be constructed from it.
We've only enabled Canvas2D on OffscreenCanvas currently, so detect this library and disable
OffscreenCanvas entirely.

* LayoutTests/fast/canvas/offscreen-disabled-construct3-quirk-expected.txt: Added.
* LayoutTests/fast/canvas/offscreen-disabled-construct3-quirk.html: Added.
* Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):

Cherry-pick: 259548.408 at safari-7615-branch (0489426718c9). <rdar://107756842>
Canonical link: https://commits.webkit.org/262741@main


Compare: https://github.com/WebKit/WebKit/compare/67d055de7fd3...171dfb71ff1d


More information about the webkit-changes mailing list