[webkit-changes] [WebKit/WebKit] b8d492: [JSC] Allow GC while running B3

Yusuke Suzuki noreply at github.com
Fri Nov 3 10:51:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b8d492e6c21d1a9835c3c9bd6f032b1fda9ab2ef
      https://github.com/WebKit/WebKit/commit/b8d492e6c21d1a9835c3c9bd6f032b1fda9ab2ef
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-11-03 (Fri, 03 Nov 2023)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/dfg/DFGGraph.cpp
    M Source/JavaScriptCore/dfg/DFGGraph.h
    M Source/JavaScriptCore/dfg/DFGLiveCatchVariablePreservationPhase.cpp
    M Source/JavaScriptCore/ftl/FTLCompile.cpp

  Log Message:
  -----------
  [JSC] Allow GC while running B3
https://bugs.webkit.org/show_bug.cgi?id=259641
rdar://113129235

Reviewed by Mark Lam and Justin Michaud.

Occasionally we observed that B3 generation is blocking GC since GC needs to suspend all compiler threads.
But B3 generation is not relying on GC things. This patch

1. Ensures that Graph::freeze is no longer called after B3 prepareForGeneration so that we already collected
   all GC weak cells before that.
2. Allow B3::generate to run GC while running.
3. Use SegmentedVector for FrozenValue since this is more efficient.
4. Make Bag<> / SegmentedVector<> use modernized, e.g. using alloc()

* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::newVariableAccessData):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* Source/JavaScriptCore/dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::registerFrozenValues):
(JSC::DFG::Graph::visitChildrenImpl):
(JSC::DFG::Graph::freeze):
* Source/JavaScriptCore/dfg/DFGGraph.h:
* Source/JavaScriptCore/dfg/DFGLiveCatchVariablePreservationPhase.cpp:
(JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData):
* Source/JavaScriptCore/ftl/FTLCompile.cpp:
(JSC::FTL::compile):

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




More information about the webkit-changes mailing list