[webkit-changes] [WebKit/WebKit] 3589dd: Fix IsoCellSet::remove()'s return value.

EWS noreply at github.com
Tue Jan 24 09:33:00 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3589dd6fe56969756161494cf76b92588a1e841b
      https://github.com/WebKit/WebKit/commit/3589dd6fe56969756161494cf76b92588a1e841b
  Author: Mark Lam <mark.lam at apple.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M Source/JavaScriptCore/heap/IsoCellSetInlines.h
    M Source/WTF/wtf/Atomics.h
    M Source/WTF/wtf/Bitmap.h

  Log Message:
  -----------
  Fix IsoCellSet::remove()'s return value.
https://bugs.webkit.org/show_bug.cgi?id=251071
<rdar://problem/104590361>

Reviewed by Yusuke Suzuki.

In https://bugs.webkit.org/show_bug.cgi?id=250847, Yijia Huang found a bug in
Bitmap::concurrentTestAndClear() where it's returning the inverse of its expected
result.  Checking for all uses of concurrentTestAndClear(), we find that one
result of IsoCellSet::remove() is also similarly incorrect.

This patch fixes these errors, and also adds comments to document the intended
return values of some relevant functions, as well as the reasoning behind how
some of the return values are computed.

Note: currently, the result of Bitmap::concurrentTestAndClear() only impacts
the return value of IsoCellSet::remove(), and, in turn, the return value of
IsoCellSet::remove() is not used anywhere.  Hence, these bugs do not currently
cause any harm.  However, it is good to fix them just for correctness and to
avoid potential future issues should we start using their return values in a
meaningful way.

* Source/JavaScriptCore/heap/IsoCellSetInlines.h:
(JSC::IsoCellSet::add):
(JSC::IsoCellSet::remove):
* Source/WTF/wtf/Atomics.h:
* Source/WTF/wtf/Bitmap.h:
(WTF::WordType>::testAndSet):
(WTF::WordType>::testAndClear):
(WTF::WordType>::concurrentTestAndSet):
(WTF::WordType>::concurrentTestAndClear):

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




More information about the webkit-changes mailing list