Add some additional test cases for bug 170896.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 06:18:15 +0000 (06:18 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 06:18:15 +0000 (06:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174491

Reviewed by Filip Pizlo.

* stress/regress-170896-with-contiguous-shape-profile.js: Copied from JSTests/stress/regress-170896.js.
* stress/regress-170896-with-double-shape-profile.js: Added.
(test):
* stress/regress-170896-with-int32-shape-profile.js: Added.
(test):
* stress/regress-170896.js: Removed.

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

JSTests/ChangeLog
JSTests/stress/regress-170896-with-contiguous-shape-profile.js [new file with mode: 0644]
JSTests/stress/regress-170896-with-double-shape-profile.js [new file with mode: 0644]
JSTests/stress/regress-170896-with-int32-shape-profile.js [moved from JSTests/stress/regress-170896.js with 75% similarity]

index cb75fff..06eb3a9 100644 (file)
@@ -1,3 +1,17 @@
+2017-07-13  Mark Lam  <mark.lam@apple.com>
+
+        Add some additional test cases for bug 170896.
+        https://bugs.webkit.org/show_bug.cgi?id=174491
+
+        Reviewed by Filip Pizlo.
+
+        * stress/regress-170896-with-contiguous-shape-profile.js: Copied from JSTests/stress/regress-170896.js.
+        * stress/regress-170896-with-double-shape-profile.js: Added.
+        (test):
+        * stress/regress-170896-with-int32-shape-profile.js: Added.
+        (test):
+        * stress/regress-170896.js: Removed.
+
 2017-07-13  Saam Barati  <sbarati@apple.com>
 
         Missing exception check in JSObject::hasInstance
diff --git a/JSTests/stress/regress-170896-with-contiguous-shape-profile.js b/JSTests/stress/regress-170896-with-contiguous-shape-profile.js
new file mode 100644 (file)
index 0000000..77af04a
--- /dev/null
@@ -0,0 +1,13 @@
+function test() {
+    let a = [,,,,,,,,,];
+    return a.concat();
+}
+noInline(test);
+
+test()[0] = {}; // Set the ArrayAllocationProfile to ContiguousShape.
+
+for (let i = 0; i < 20000; ++i) {
+    var result = test();
+    if (result[0])
+        throw result.toString();
+}
diff --git a/JSTests/stress/regress-170896-with-double-shape-profile.js b/JSTests/stress/regress-170896-with-double-shape-profile.js
new file mode 100644 (file)
index 0000000..abda98b
--- /dev/null
@@ -0,0 +1,13 @@
+function test() {
+    let a = [,,,,,,,,,];
+    return a.concat();
+}
+noInline(test);
+
+test()[0] = 1.2345; // Set the ArrayAllocationProfile to DoubleShape.
+
+for (let i = 0; i < 20000; ++i) {
+    var result = test();
+    if (result[0])
+        throw result.toString();
+}
similarity index 75%
rename from JSTests/stress/regress-170896.js
rename to JSTests/stress/regress-170896-with-int32-shape-profile.js
index 6d19027..e792bd1 100644 (file)
@@ -4,7 +4,7 @@ function test() {
 }
 noInline(test);
 
-test()[0] = {};
+test()[0] = 42; // Set the ArrayAllocationProfile to Int32Shape.
 
 for (let i = 0; i < 20000; ++i) {
     var result = test();