⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242747 in webkit


Ignore:
Timestamp:
Mar 11, 2019, 3:37:43 PM (7 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Make StaticStringImpl & StaticSymbolImpl actually static
https://bugs.webkit.org/show_bug.cgi?id=194212

Reviewed by Mark Lam.

Avoid mutation onto refcounts if isStatic() returns true so that the content of StaticStringImpl never gets modified.

  • wtf/text/StringImpl.h:

(WTF::StringImpl::ref):
(WTF::StringImpl::deref):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r242732 r242747  
     12019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
     4        https://bugs.webkit.org/show_bug.cgi?id=194212
     5
     6        Reviewed by Mark Lam.
     7
     8        Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
     9
     10        * wtf/text/StringImpl.h:
     11        (WTF::StringImpl::ref):
     12        (WTF::StringImpl::deref):
     13
    1142019-03-11  Sihui Liu  <sihui_liu@apple.com>
    215
  • trunk/Source/WTF/wtf/text/StringImpl.h

    r242252 r242747  
    10651065    STRING_STATS_REF_STRING(*this);
    10661066
     1067    if (UNLIKELY(isStatic()))
     1068        return;
    10671069    m_refCount += s_refCountIncrement;
    10681070}
     
    10721074    STRING_STATS_DEREF_STRING(*this);
    10731075
     1076    if (UNLIKELY(isStatic()))
     1077        return;
    10741078    unsigned tempRefCount = m_refCount - s_refCountIncrement;
    10751079    if (!tempRefCount) {
Note: See TracChangeset for help on using the changeset viewer.