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

Changeset 221192 in webkit


Ignore:
Timestamp:
Aug 25, 2017, 10:27:46 AM (9 years ago)
Author:
keith_miller@apple.com
Message:

Explore increasing max JSString::m_length to UINT_MAX.
​https://bugs.webkit.org/show_bug.cgi?id=163955
<rdar://problem/32001499>

Reviewed by JF Bastien.

This can cause us to release assert on some code paths. I don't
see a reason to maintain this restriction.

  • runtime/JSString.h:

(JSC::JSString::length const):
(JSC::JSString::setLength):
(JSC::JSString::isValidLength): Deleted.

  • runtime/JSStringBuilder.h:

(JSC::jsMakeNontrivialString):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r221176 r221192  
     12017-08-25  Keith Miller  <keith_miller@apple.com>
     2
     3        Explore increasing max JSString::m_length to UINT_MAX.
     4        https://bugs.webkit.org/show_bug.cgi?id=163955
     5        <rdar://problem/32001499>
     6
     7        Reviewed by JF Bastien.
     8
     9        This can cause us to release assert on some code paths. I don't
     10        see a reason to maintain this restriction.
     11
     12        * runtime/JSString.h:
     13        (JSC::JSString::length const):
     14        (JSC::JSString::setLength):
     15        (JSC::JSString::isValidLength): Deleted.
     16        * runtime/JSStringBuilder.h:
     17        (JSC::jsMakeNontrivialString):
     18
    1192017-08-24  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r216699 r221192  
    165165    const StringImpl* tryGetValueImpl() const;
    166166    ALWAYS_INLINE unsigned length() const { return m_length; }
    167     ALWAYS_INLINE static bool isValidLength(size_t length)
    168     {
    169         // While length is of type unsigned, the runtime and compilers are all
    170         // expecting that m_length is a positive value <= INT_MAX.
    171         // FIXME: Look into making the max length UINT_MAX to match StringImpl's max length.
    172         // https://bugs.webkit.org/show_bug.cgi?id=163955
    173         return length <= std::numeric_limits<int32_t>::max();
    174     }
    175167
    176168    JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
    … …  
    220212    ALWAYS_INLINE void setLength(unsigned length)
    221213    {
    222         RELEASE_ASSERT(isValidLength(length));
    223214        m_length = length;
    224215    }
  • trunk/Source/JavaScriptCore/runtime/JSStringBuilder.h

    r209761 r221192  
    132132    auto scope = DECLARE_THROW_SCOPE(vm);
    133133    String result = tryMakeString(string, strings...);
    134     if (UNLIKELY(!result || !JSString::isValidLength(result.length())))
     134    if (UNLIKELY(!result))
    135135        return throwOutOfMemoryError(exec, scope);
    136136    return jsNontrivialString(exec, WTFMove(result));
Note: See TracChangeset for help on using the changeset viewer.