Ignore:
Timestamp:
Aug 25, 2017, 10:27:46 AM (8 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.