Title: [153192] trunk/LayoutTests
Revision
153192
Author
[email protected]
Date
2013-07-24 21:01:26 -0700 (Wed, 24 Jul 2013)

Log Message

fourthTier: fast/js should have a way of running tests long enough to wait for the concurrent JIT to tier up
https://bugs.webkit.org/show_bug.cgi?id=116878

Reviewed by Oliver Hunt.

This adds three things to js-test-pre and uses them in one representative test:

silentTestPass: If you set this to true, then testPassed() won't print anything, and will instead just have
    isSuccessfullyParsed() print a message saying that some tests passed silently. This allows tests to call
    shouldBe() and friends in a loop whose running time is dependent on concurrent JIT behavior, and still
    be sure that the resulting test will be deterministic.

noInline(): If testRunner is present, disable inlining of the relevant function.

dfgIncrement({f:function, i:index, n:limit}): Returns index either if index < limit, or if the function is
    DFG compiled. Otherwise, if index >= limit and the function isn't DFG compiled, return 0. This means
    that the 'i++' in the fast/js/dfg-* warm-up loops can be replaced with:

    i = dfgIncrement({f:<function you're interested in>, i:i + 1, n:<some number smaller than the loop condition>)

    This has the effect of having the loop repeat the first 'n' iterations until the function is DFG
    compiled. See the modified test, where we do n:100 and the loop condition is i < 200. So the loop will
    repeat the first 100 iterations until the function is DFG compiled and will only do the last 100
    iterations once DFG compilation kicks in.

* fast/js/dfg-arguments-osr-exit-multiple-blocks-expected.txt:
* fast/js/resources/js-test-pre.js:
(testPassed):
(dfgIncrement):
(noInline):
(isSuccessfullyParsed):
* fast/js/script-tests/dfg-arguments-osr-exit-multiple-blocks.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (153191 => 153192)


--- trunk/LayoutTests/ChangeLog	2013-07-25 04:01:24 UTC (rev 153191)
+++ trunk/LayoutTests/ChangeLog	2013-07-25 04:01:26 UTC (rev 153192)
@@ -1,5 +1,40 @@
 2013-05-28  Filip Pizlo  <[email protected]>
 
+        fourthTier: fast/js should have a way of running tests long enough to wait for the concurrent JIT to tier up
+        https://bugs.webkit.org/show_bug.cgi?id=116878
+
+        Reviewed by Oliver Hunt.
+
+        This adds three things to js-test-pre and uses them in one representative test:
+
+        silentTestPass: If you set this to true, then testPassed() won't print anything, and will instead just have
+            isSuccessfullyParsed() print a message saying that some tests passed silently. This allows tests to call
+            shouldBe() and friends in a loop whose running time is dependent on concurrent JIT behavior, and still
+            be sure that the resulting test will be deterministic.
+        
+        noInline(): If testRunner is present, disable inlining of the relevant function.
+
+        dfgIncrement({f:function, i:index, n:limit}): Returns index either if index < limit, or if the function is
+            DFG compiled. Otherwise, if index >= limit and the function isn't DFG compiled, return 0. This means
+            that the 'i++' in the fast/js/dfg-* warm-up loops can be replaced with:
+
+            i = dfgIncrement({f:<function you're interested in>, i:i + 1, n:<some number smaller than the loop condition>)
+
+            This has the effect of having the loop repeat the first 'n' iterations until the function is DFG
+            compiled. See the modified test, where we do n:100 and the loop condition is i < 200. So the loop will
+            repeat the first 100 iterations until the function is DFG compiled and will only do the last 100
+            iterations once DFG compilation kicks in.    
+
+        * fast/js/dfg-arguments-osr-exit-multiple-blocks-expected.txt:
+        * fast/js/resources/js-test-pre.js:
+        (testPassed):
+        (dfgIncrement):
+        (noInline):
+        (isSuccessfullyParsed):
+        * fast/js/script-tests/dfg-arguments-osr-exit-multiple-blocks.js:
+
+2013-05-28  Filip Pizlo  <[email protected]>
+
         testRunner should have a way of disabling inlining of functions
         https://bugs.webkit.org/show_bug.cgi?id=116875
 

Modified: trunk/LayoutTests/fast/js/dfg-arguments-osr-exit-multiple-blocks-expected.txt (153191 => 153192)


--- trunk/LayoutTests/fast/js/dfg-arguments-osr-exit-multiple-blocks-expected.txt	2013-07-25 04:01:24 UTC (rev 153191)
+++ trunk/LayoutTests/fast/js/dfg-arguments-osr-exit-multiple-blocks-expected.txt	2013-07-25 04:01:26 UTC (rev 153192)
@@ -3,207 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is 74
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS bar(42) is "4232"
-PASS successfullyParsed is true
+Passed some tests silently.
 
 TEST COMPLETE
 

Modified: trunk/LayoutTests/fast/js/resources/js-test-pre.js (153191 => 153192)


--- trunk/LayoutTests/fast/js/resources/js-test-pre.js	2013-07-25 04:01:24 UTC (rev 153191)
+++ trunk/LayoutTests/fast/js/resources/js-test-pre.js	2013-07-25 04:01:26 UTC (rev 153192)
@@ -2,8 +2,11 @@
 if (self.testRunner)
     testRunner.dumpAsText(self.enablePixelTesting);
 
-var description, debug, successfullyParsed, errorMessage;
+var description, debug, successfullyParsed, errorMessage, silentTestPass, didPassSomeTestsSilently;
 
+silentTestPass = false;
+didPassSomeTestsSilently = false;
+
 (function() {
 
     function getOrCreate(id, tagName)
@@ -96,7 +99,10 @@
 
 function testPassed(msg)
 {
-    debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
+    if (silentTestPass)
+        didPassSomeTestsSilently = true;
+    else
+        debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
 }
 
 function testFailed(msg)
@@ -564,12 +570,45 @@
     }
 }
 
+function dfgIncrement(argument)
+{
+    if (!self.testRunner)
+        return argument.i;
+    
+    if (argument.i < argument.n)
+        return argument.i;
+    
+    var numberOfCompiles = "compiles" in argument ? argument.compiles : 1;
+    
+    if (argument.f instanceof Array) {
+        for (var i = 0; i < argument.f.length; ++i) {
+            if (testRunner.numberOfDFGCompiles(argument.f[i]) < numberOfCompiles)
+                return 0;
+        }
+    } else {
+        if (testRunner.numberOfDFGCompiles(argument.f) < numberOfCompiles)
+            return 0;
+    }
+    
+    return argument.i;
+}
+
+function noInline(theFunction)
+{
+    if (!self.testRunner)
+        return;
+    
+    testRunner.neverInlineFunction(theFunction);
+}
+
 function isSuccessfullyParsed()
 {
     // FIXME: Remove this and only report unexpected syntax errors.
     if (!errorMessage)
         successfullyParsed = true;
     shouldBeTrue("successfullyParsed");
+    if (silentTestPass && didPassSomeTestsSilently)
+        debug("Passed some tests silently.");
     debug('<br /><span class="pass">TEST COMPLETE</span>');
 }
 

Modified: trunk/LayoutTests/fast/js/script-tests/dfg-arguments-osr-exit-multiple-blocks.js (153191 => 153192)


--- trunk/LayoutTests/fast/js/script-tests/dfg-arguments-osr-exit-multiple-blocks.js	2013-07-25 04:01:24 UTC (rev 153191)
+++ trunk/LayoutTests/fast/js/script-tests/dfg-arguments-osr-exit-multiple-blocks.js	2013-07-25 04:01:26 UTC (rev 153192)
@@ -2,6 +2,8 @@
 "Tests aliased uses of 'arguments' that require reification of the Arguments object on OSR exit, in the case that there is some interesting control flow."
 );
 
+silentTestPass = true;
+
 function baz() {
     return [variable];
 }
@@ -24,10 +26,12 @@
     return foo(x);
 }
 
+noInline(bar);
+
 var variable = 32;
 var expected = "74";
 
-for (var i = 0; i < 200; ++i) {
+for (var i = 0; i < 200; i = dfgIncrement({f:bar, i:i + 1, n:100})) {
     if (i == 150) {
         variable = "32";
         expected = "\"4232\"";
@@ -35,3 +39,4 @@
     
     shouldBe("bar(42)", expected);
 }
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to