Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 82c4913a2116d0321bed425dfae637f402000fa0
      
https://github.com/WebKit/WebKit/commit/82c4913a2116d0321bed425dfae637f402000fa0
  Author: Vassili Bykov <[email protected]>
  Date:   2026-03-28 (Sat, 28 Mar 2026)

  Changed paths:
    M Source/WTF/wtf/InlineMap.h
    M Tools/TestWebKitAPI/Tests/WTF/InlineMap.cpp

  Log Message:
  -----------
  [JSC] Improve the removal logic in InlineMap
https://bugs.webkit.org/show_bug.cgi?id=310928
rdar://173536817

Reviewed by Yusuke Suzuki.

The original implementation of InlineMap comes with very simple removal logic 
which does
nothing to compact deleted entries as they accumulate, or to shrink the map. 
This is not
an immediate problem because in VariableEnvironments where InlineMap is used 
removal never
happens. But as it's a library class we might start using in other places, 
let's improve
the existing implementation.

This patch changes the implementation to track the number of deleted entries 
and compact
the map or shrink it to a smaller size as needed, including switching back to 
linear mode
if the map becomes small enough. The compaction/shrinking policy and logic 
mirror what
happens in HashTable.

Tests: Tools/TestWebKitAPI/Tests/WTF/InlineMap.cpp - added new tests
Canonical link: https://commits.webkit.org/310162@main



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

Reply via email to