Title: [221192] trunk/Source/_javascript_Core
Revision
221192
Author
[email protected]
Date
2017-08-25 10:27:46 -0700 (Fri, 25 Aug 2017)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (221191 => 221192)


--- trunk/Source/_javascript_Core/ChangeLog	2017-08-25 17:23:20 UTC (rev 221191)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-08-25 17:27:46 UTC (rev 221192)
@@ -1,3 +1,21 @@
+2017-08-25  Keith Miller  <[email protected]>
+
+        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):
+
 2017-08-24  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r221119, r221124, and r221143.

Modified: trunk/Source/_javascript_Core/runtime/JSString.h (221191 => 221192)


--- trunk/Source/_javascript_Core/runtime/JSString.h	2017-08-25 17:23:20 UTC (rev 221191)
+++ trunk/Source/_javascript_Core/runtime/JSString.h	2017-08-25 17:27:46 UTC (rev 221192)
@@ -164,14 +164,6 @@
     const String& tryGetValue() const;
     const StringImpl* tryGetValueImpl() const;
     ALWAYS_INLINE unsigned length() const { return m_length; }
-    ALWAYS_INLINE static bool isValidLength(size_t length)
-    {
-        // While length is of type unsigned, the runtime and compilers are all
-        // expecting that m_length is a positive value <= INT_MAX.
-        // FIXME: Look into making the max length UINT_MAX to match StringImpl's max length.
-        // https://bugs.webkit.org/show_bug.cgi?id=163955
-        return length <= std::numeric_limits<int32_t>::max();
-    }
 
     JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
     bool toBoolean() const { return !!length(); }
@@ -219,7 +211,6 @@
 
     ALWAYS_INLINE void setLength(unsigned length)
     {
-        RELEASE_ASSERT(isValidLength(length));
         m_length = length;
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSStringBuilder.h (221191 => 221192)


--- trunk/Source/_javascript_Core/runtime/JSStringBuilder.h	2017-08-25 17:23:20 UTC (rev 221191)
+++ trunk/Source/_javascript_Core/runtime/JSStringBuilder.h	2017-08-25 17:27:46 UTC (rev 221192)
@@ -131,7 +131,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     String result = tryMakeString(string, strings...);
-    if (UNLIKELY(!result || !JSString::isValidLength(result.length())))
+    if (UNLIKELY(!result))
         return throwOutOfMemoryError(exec, scope);
     return jsNontrivialString(exec, WTFMove(result));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to