Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f8a1572e3a8eb244d7f096ecf7f17b96184c9116
      
https://github.com/WebKit/WebKit/commit/f8a1572e3a8eb244d7f096ecf7f17b96184c9116
  Author: Dan Hecht <[email protected]>
  Date:   2026-03-27 (Fri, 27 Mar 2026)

  Changed paths:
    M Source/JavaScriptCore/b3/air/AirTmpMap.h
    M Source/WTF/wtf/IndexMap.h

  Log Message:
  -----------
  [JSC] IndexMap::resize should not overwrite existing elements
https://bugs.webkit.org/show_bug.cgi?id=310847
rdar://173451278

Reviewed by Yusuke Suzuki.

IndexMap::resize was using Vector::fill, which overwrites all elements
including existing ones. This is surprising since resize usually
means to change the size but leave existing elements in place.

So make IndexMap::resize (and TmpMap::resize) follow the standard behavior.
An upcoming change will need this true resize behavior.

All current callers resize from empty, so this is a no-op for existing
code.

Also remove TmpMap::clear which called nonexistent IndexMap::remove and
had no callers, and simplify TmpMap::resize to match.

Covered by existing JSC stress tests
* Source/JavaScriptCore/b3/air/AirTmpMap.h:
(JSC::B3::Air::TmpMap::resize):
(JSC::B3::Air::TmpMap::clear): Deleted.
* Source/WTF/wtf/IndexMap.h:
(WTF::IndexMap::resize):

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



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

Reply via email to