Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d08c15c73b5124b56db6f1123bbb23cb55ad9535
      
https://github.com/WebKit/WebKit/commit/d08c15c73b5124b56db6f1123bbb23cb55ad9535
  Author: Mark Lam <[email protected]>
  Date:   2026-06-16 (Tue, 16 Jun 2026)

  Changed paths:
    M Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp
    M Source/JavaScriptCore/heap/FullGCActivityCallback.cpp
    M Source/JavaScriptCore/heap/GCActivityCallback.cpp
    M Source/JavaScriptCore/heap/GCActivityCallback.h
    M Source/JavaScriptCore/heap/Heap.cpp
    M Source/JavaScriptCore/runtime/OptionsList.h

  Log Message:
  -----------
  Fix callers of GCActivityCallback's didAllocate() to update allocated and 
abandoned bytes first.
https://bugs.webkit.org/show_bug.cgi?id=317232
rdar://179854263

Reviewed by Yusuke Suzuki.

Current code is updating the number of allocated and abandoned bytes after it 
calls
GCActivityCallback's didAllocate().  didAllocate() uses the number of allocated 
and
abandoned bytes to decide when GC needs to run next.  This means didAllocate() 
is being
fed the wrong / stale number of bytes.  Hence, its ability to decide when to 
run GC next
is impaired.

After fixing this, GC heuristics also need to be re-tuned to keep performance 
neutral on
benchmarks.  At this point, this simply means changing 
Options::collectionTimerMaxPercentCPU()
from 0.05 to 0.10.  With that, benchmark results are neutral.

Also refactored GCActivityCallback subclasses to call a common 
GCActivityCallback::deathRate
instead of duplicating code.  These functions are not in any critical hot path.

No new tests because this only changes performance characteristics.  It does 
not change
anything in terms of correctness.  The effects of this change will be monitored 
by
existing performance test bots.

* Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp:
(JSC::EdenGCActivityCallback::deathRate):
* Source/JavaScriptCore/heap/FullGCActivityCallback.cpp:
(JSC::FullGCActivityCallback::deathRate):
* Source/JavaScriptCore/heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::deathRate):
* Source/JavaScriptCore/heap/GCActivityCallback.h:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::reportAbandonedObjectGraph):
(JSC::Heap::clearConcurrentRetainedDataIfPossible):
* Source/JavaScriptCore/runtime/OptionsList.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to