Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a98619eaf5aab9fffb6856b8254038a10a67092a
      
https://github.com/WebKit/WebKit/commit/a98619eaf5aab9fffb6856b8254038a10a67092a
  Author: Yusuke Suzuki <ysuz...@apple.com>
  Date:   2024-04-16 (Tue, 16 Apr 2024)

  Changed paths:
    M Source/JavaScriptCore/bytecode/CodeBlock.cpp
    M Source/JavaScriptCore/bytecode/RecordedStatuses.cpp
    M Source/JavaScriptCore/bytecode/RecordedStatuses.h
    M Source/JavaScriptCore/dfg/DFGCommonData.h
    M Source/JavaScriptCore/dfg/DFGDesiredWeakReferences.cpp
    M Source/JavaScriptCore/dfg/DFGPlan.cpp
    M Source/JavaScriptCore/dfg/DFGPlan.h

  Log Message:
  -----------
  [JSC] Make DFG finalization less locking
https://bugs.webkit.org/show_bug.cgi?id=272722
rdar://126521673

Reviewed by Justin Michaud.

Make DFG finalization less locking, which makes operationOptimize less
frequently taking a lock & stopping accidentally with heap threads.

In this patch,

1. Weak reference FixedVector moving does not need to take a lock. They are 
pointer size move. And old field was always nullptr.
   (Keep in mind that we always emit write-barrier onto CodeBlock when 
finishing finalization, and GC is deferred during finalization.
    So any kind of added references etc. does not matter even without 
write-barrier etc.).
2. Make RecordedStatuses std::unique_ptr and move it to CodeBlock without a 
lock. Due to (1)'s reason, this is also fine.

* Source/JavaScriptCore/bytecode/CodeBlock.cpp:
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::getICStatusMap):
(JSC::CodeBlock::stronglyVisitStrongReferences):
* Source/JavaScriptCore/bytecode/RecordedStatuses.cpp:
(JSC::RecordedStatuses::operator=): Deleted.
(JSC::RecordedStatuses::RecordedStatuses): Deleted.
* Source/JavaScriptCore/bytecode/RecordedStatuses.h:
(JSC::RecordedStatuses::RecordedStatuses): Deleted.
* Source/JavaScriptCore/dfg/DFGCommonData.h:
* Source/JavaScriptCore/dfg/DFGDesiredWeakReferences.cpp:
(JSC::DFG::DesiredWeakReferences::reallyAdd):
* Source/JavaScriptCore/dfg/DFGPlan.cpp:
(JSC::DFG::Plan::finalizeInGC):
(JSC::DFG::Plan::compileInThreadImpl):
(JSC::DFG::Plan::finalizeInThread):
(JSC::DFG::Plan::reallyAdd):
(JSC::DFG::Plan::finalize):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
* Source/JavaScriptCore/dfg/DFGPlan.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to