Title: [180453] trunk/LayoutTests
Revision
180453
Author
msab...@apple.com
Date
2015-02-20 14:21:47 -0800 (Fri, 20 Feb 2015)

Log Message

Layout Test js/regress-141098.html is failing on 32-bit Machines
https://bugs.webkit.org/show_bug.cgi?id=141848

Reviewed by Geoffrey Garen.

It appears that different control flow paths in probeAndRecurse() allowed the second time
through the test to recurse deeper before getting to the point of overflowing the stack.
Restructured the test so that the exact same control flow in probeAndRecurse() is used
both times we call it, including probing the depth of the stack.  Now we pass a flag that
indicates whether or not we should try ever expanding eval strings or reuse the most
recent eval string.

* js/script-tests/regress-141098.js:
(testEval):
(probeAndRecurse):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (180452 => 180453)


--- trunk/LayoutTests/ChangeLog	2015-02-20 21:51:37 UTC (rev 180452)
+++ trunk/LayoutTests/ChangeLog	2015-02-20 22:21:47 UTC (rev 180453)
@@ -1,3 +1,21 @@
+2015-02-20  Michael Saboff  <msab...@apple.com>
+
+        Layout Test js/regress-141098.html is failing on 32-bit Machines
+        https://bugs.webkit.org/show_bug.cgi?id=141848
+
+        Reviewed by Geoffrey Garen.
+
+        It appears that different control flow paths in probeAndRecurse() allowed the second time
+        through the test to recurse deeper before getting to the point of overflowing the stack.
+        Restructured the test so that the exact same control flow in probeAndRecurse() is used
+        both times we call it, including probing the depth of the stack.  Now we pass a flag that
+        indicates whether or not we should try ever expanding eval strings or reuse the most
+        recent eval string.
+
+        * js/script-tests/regress-141098.js:
+        (testEval):
+        (probeAndRecurse):
+
 2015-02-20  Brent Fulgham  <bfulg...@apple.com>
 
         Skip failing JSC stress test to get bots green.

Modified: trunk/LayoutTests/js/script-tests/regress-141098.js (180452 => 180453)


--- trunk/LayoutTests/js/script-tests/regress-141098.js	2015-02-20 21:51:37 UTC (rev 180452)
+++ trunk/LayoutTests/js/script-tests/regress-141098.js	2015-02-20 22:21:47 UTC (rev 180453)
@@ -1,5 +1,3 @@
-//@ skip
-
 description("Regression test for https://webkit.org/b/141098. Make sure eval() properly handles running out of stack space. This test should run without crashing.");
 
 // The tiering up to test higher levels of optimization will only test the DFG
@@ -12,9 +10,9 @@
     var result;
     var count = 1;
 
-    if (!maxIterations) {
+    if (!maxIterations)
         var result = eval(lastEvalString);
-    } else {
+    else {
         for (var iter = 0; iter < maxIterations; count *= 4, iter++) {
             var evalString = "\"dummy\".valueOf(";
 
@@ -26,7 +24,8 @@
 
             evalString +=  ");";
 
-            lastEvalString = evalString;
+            if (maxIterations > 1)
+                lastEvalString = evalString;
             result = eval(evalString);
         }
     }
@@ -34,33 +33,30 @@
     return result;
 }
 
-function probeAndRecurse(depth)
+function probeAndRecurse(depth, reuseEvalString)
 {
     var result;
 
     // Probe stack depth
-    if (depth > 0) {
-        try {
-            result = probeAndRecurse(depth+1);
+    try {
+        result = probeAndRecurse(depth+1, reuseEvalString);
 
-            if (!result) {
-                try {
-                    testEval(1);
-                } catch (e) {
-                    return -49;
-                }
-            } else
-                return result + 1
-        } catch (e) {
-            // We exceeded stack space, now return up the stack until we can execute a simple eval.
-            // Then run an eval test to exceed stack.
-            return -49;
-        }
-    } else if (depth != 0)
-        return probeAndRecurse(depth+1);
+        if (!result) {
+            try {
+                testEval(1);
+            } catch (e) {
+                return -49;
+            }
+        } else
+            return result + 1
+    } catch (e) {
+        // We exceeded stack space, now return up the stack until we can execute a simple eval.
+        // Then run an eval test to exceed stack.
+        return -49;
+    }
 
     try {
-        testEval((depth > 0) ? 20 : 0);
+        testEval(reuseEvalString ? 0 : 20);
     } catch (e) {
         testPassed("Exception: " + e);
     }
@@ -68,7 +64,7 @@
     return 1;
 }
 
-var depth = probeAndRecurse(1);
+var depth = probeAndRecurse(0, false);
 
 // Tier up the eval'ed code.
 // When run with run-jsc-stress-tests and it's agressive options, this low of a count will
@@ -76,4 +72,4 @@
 for (var i = 0; i < 200; i++)
     testEval(0);
 
-probeAndRecurse(-depth);
+probeAndRecurse(0, true);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to