Title: [289274] branches/safari-613-branch
Revision
289274
Author
[email protected]
Date
2022-02-07 18:53:15 -0800 (Mon, 07 Feb 2022)

Log Message

Cherry-pick r288037. rdar://problem/87538657

    JSStringJoiner's constructor should take a size_t length.
    https://bugs.webkit.org/show_bug.cgi?id=235217
    rdar://87538657

    Reviewed by Yusuke Suzuki.

    JSTests:

    * stress/max-typed-array-length-toString.js: Added.

    Source/_javascript_Core:

    Also removed an unnecessary exception check in JSStringJoiner::append().
    This is because appendWithoutSideEffects() cannot throw any exceptions.

    * runtime/JSStringJoiner.h:
    (JSC::JSStringJoiner::JSStringJoiner):
    (JSC::JSStringJoiner::append):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288037 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-613-branch/JSTests/ChangeLog (289273 => 289274)


--- branches/safari-613-branch/JSTests/ChangeLog	2022-02-08 02:53:12 UTC (rev 289273)
+++ branches/safari-613-branch/JSTests/ChangeLog	2022-02-08 02:53:15 UTC (rev 289274)
@@ -1,3 +1,39 @@
+2022-02-07  Russell Epstein  <[email protected]>
+
+        Cherry-pick r288037. rdar://problem/87538657
+
+    JSStringJoiner's constructor should take a size_t length.
+    https://bugs.webkit.org/show_bug.cgi?id=235217
+    rdar://87538657
+    
+    Reviewed by Yusuke Suzuki.
+    
+    JSTests:
+    
+    * stress/max-typed-array-length-toString.js: Added.
+    
+    Source/_javascript_Core:
+    
+    Also removed an unnecessary exception check in JSStringJoiner::append().
+    This is because appendWithoutSideEffects() cannot throw any exceptions.
+    
+    * runtime/JSStringJoiner.h:
+    (JSC::JSStringJoiner::JSStringJoiner):
+    (JSC::JSStringJoiner::append):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-01-14  Mark Lam  <[email protected]>
+
+            JSStringJoiner's constructor should take a size_t length.
+            https://bugs.webkit.org/show_bug.cgi?id=235217
+            rdar://87538657
+
+            Reviewed by Yusuke Suzuki.
+
+            * stress/max-typed-array-length-toString.js: Added.
+
 2022-01-07  Alexey Shvayka  <[email protected]>
 
         Expand the set of objects we take JSArray::fastSlice() path for

Added: branches/safari-613-branch/JSTests/stress/max-typed-array-length-toString.js (0 => 289274)


--- branches/safari-613-branch/JSTests/stress/max-typed-array-length-toString.js	                        (rev 0)
+++ branches/safari-613-branch/JSTests/stress/max-typed-array-length-toString.js	2022-02-08 02:53:15 UTC (rev 289274)
@@ -0,0 +1,14 @@
+//@ skip if $architecture != "arm64" && $architecture != "x86-64"
+
+var exception;
+try {
+    var memory = new WebAssembly.Memory({
+        initial: 65536
+    });
+    new Uint8Array(memory.buffer).toString();
+} catch (e) {
+    exception = e;
+}
+
+if (exception != "RangeError: Out of memory")
+    throw "FAILED: " + exception;

Modified: branches/safari-613-branch/Source/_javascript_Core/ChangeLog (289273 => 289274)


--- branches/safari-613-branch/Source/_javascript_Core/ChangeLog	2022-02-08 02:53:12 UTC (rev 289273)
+++ branches/safari-613-branch/Source/_javascript_Core/ChangeLog	2022-02-08 02:53:15 UTC (rev 289274)
@@ -1,3 +1,44 @@
+2022-02-07  Russell Epstein  <[email protected]>
+
+        Cherry-pick r288037. rdar://problem/87538657
+
+    JSStringJoiner's constructor should take a size_t length.
+    https://bugs.webkit.org/show_bug.cgi?id=235217
+    rdar://87538657
+    
+    Reviewed by Yusuke Suzuki.
+    
+    JSTests:
+    
+    * stress/max-typed-array-length-toString.js: Added.
+    
+    Source/_javascript_Core:
+    
+    Also removed an unnecessary exception check in JSStringJoiner::append().
+    This is because appendWithoutSideEffects() cannot throw any exceptions.
+    
+    * runtime/JSStringJoiner.h:
+    (JSC::JSStringJoiner::JSStringJoiner):
+    (JSC::JSStringJoiner::append):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-01-14  Mark Lam  <[email protected]>
+
+            JSStringJoiner's constructor should take a size_t length.
+            https://bugs.webkit.org/show_bug.cgi?id=235217
+            rdar://87538657
+
+            Reviewed by Yusuke Suzuki.
+
+            Also removed an unnecessary exception check in JSStringJoiner::append().
+            This is because appendWithoutSideEffects() cannot throw any exceptions.
+
+            * runtime/JSStringJoiner.h:
+            (JSC::JSStringJoiner::JSStringJoiner):
+            (JSC::JSStringJoiner::append):
+
 2022-01-28  Russell Epstein  <[email protected]>
 
         Cherry-pick r287961. rdar://problem/86282584

Modified: branches/safari-613-branch/Source/_javascript_Core/runtime/JSStringJoiner.h (289273 => 289274)


--- branches/safari-613-branch/Source/_javascript_Core/runtime/JSStringJoiner.h	2022-02-08 02:53:12 UTC (rev 289273)
+++ branches/safari-613-branch/Source/_javascript_Core/runtime/JSStringJoiner.h	2022-02-08 02:53:15 UTC (rev 289274)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,8 +33,8 @@
 
 class JSStringJoiner {
 public:
-    JSStringJoiner(JSGlobalObject*, LChar separator, unsigned stringCount);
-    JSStringJoiner(JSGlobalObject*, StringView separator, unsigned stringCount);
+    JSStringJoiner(JSGlobalObject*, LChar separator, size_t stringCount);
+    JSStringJoiner(JSGlobalObject*, StringView separator, size_t stringCount);
     ~JSStringJoiner();
 
     void append(JSGlobalObject*, JSValue);
@@ -57,7 +57,7 @@
     bool m_isAll8Bit { true };
 };
 
-inline JSStringJoiner::JSStringJoiner(JSGlobalObject* globalObject, StringView separator, unsigned stringCount)
+inline JSStringJoiner::JSStringJoiner(JSGlobalObject* globalObject, StringView separator, size_t stringCount)
     : m_separator(separator)
     , m_isAll8Bit(m_separator.is8Bit())
 {
@@ -67,7 +67,7 @@
         throwOutOfMemoryError(globalObject, scope);
 }
 
-inline JSStringJoiner::JSStringJoiner(JSGlobalObject* globalObject, LChar separator, unsigned stringCount)
+inline JSStringJoiner::JSStringJoiner(JSGlobalObject* globalObject, LChar separator, size_t stringCount)
     : m_singleCharacterSeparator(separator)
     , m_separator { &m_singleCharacterSeparator, 1 }
 {
@@ -152,7 +152,6 @@
     auto scope = DECLARE_THROW_SCOPE(vm);
 
     bool success = appendWithoutSideEffects(globalObject, value);
-    RETURN_IF_EXCEPTION(scope, void());
     if (!success) {
         JSString* jsString = value.toString(globalObject);
         RETURN_IF_EXCEPTION(scope, void());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to