[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

atwilson at chromium.org atwilson at chromium.org
Thu Oct 29 20:37:47 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit ac8b946ac8a348935b3057727aad65c07189296d
Author: atwilson at chromium.org <atwilson at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 1 20:27:05 2009 +0000

    REGRESSION: fast/workers/dedicated-worker-lifecycle.html failing intermittently on leopard bot
    https://bugs.webkit.org/show_bug.cgi?id=29344
    
    Reviewed by Eric Seidel.
    
    * fast/workers/resources/dedicated-worker-lifecycle.js:
    (runTests):
    Allocate objects on the stack to try to force a GC to eliminate flakiness.
    * fast/workers/resources/worker-util.js:
    (gc):
    Added an optional "forceAlloc" parameter which causes a more extensive stack-clobbering algorithm to be run.
    (waitUntilThreadCountMatches):
    Pass the forceAlloc flag to gc() to try to force unreferenced workers to get GC'd.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48996 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9e37018..6e487ee 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2009-10-01  Drew Wilson  <atwilson at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        REGRESSION: fast/workers/dedicated-worker-lifecycle.html failing intermittently on leopard bot
+        https://bugs.webkit.org/show_bug.cgi?id=29344
+
+        * fast/workers/resources/dedicated-worker-lifecycle.js:
+        (runTests):
+        Allocate objects on the stack to try to force a GC to eliminate flakiness.
+        * fast/workers/resources/worker-util.js:
+        (gc):
+        Added an optional "forceAlloc" parameter which causes a more extensive stack-clobbering algorithm to be run.
+        (waitUntilThreadCountMatches):
+        Pass the forceAlloc flag to gc() to try to force unreferenced workers to get GC'd.
+
 2009-10-01  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Rubberstamped by Simon Hausmann.
diff --git a/LayoutTests/fast/workers/resources/dedicated-worker-lifecycle.js b/LayoutTests/fast/workers/resources/dedicated-worker-lifecycle.js
index 2db3a70..ff6c5ac 100644
--- a/LayoutTests/fast/workers/resources/dedicated-worker-lifecycle.js
+++ b/LayoutTests/fast/workers/resources/dedicated-worker-lifecycle.js
@@ -26,6 +26,8 @@ function runTests()
         // Orphan our worker (no more references to it) and wait for it to exit.
         worker.onmessage = 0;
         worker = 0;
+        // Allocating a Date object seems to scramble the stack and force the worker object to get GC'd.
+        new Date();
         waitUntilWorkerThreadsExit(orphanedWorkerExited);
     }
 }
diff --git a/LayoutTests/fast/workers/resources/worker-util.js b/LayoutTests/fast/workers/resources/worker-util.js
index 206eed1..20e799a 100644
--- a/LayoutTests/fast/workers/resources/worker-util.js
+++ b/LayoutTests/fast/workers/resources/worker-util.js
@@ -5,13 +5,21 @@ function log(message)
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
-function gc()
+function gc(forceAlloc)
 {
-    if (window.GCController)
-        return GCController.collect();
+    if (typeof GCController !== "undefined")
+        GCController.collect();
 
-    for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires about 9K allocations before a collect)
-        var s = new String("abc");
+    if (typeof GCController == "undefined" || forceAlloc) {
+        function gcRec(n) {
+            if (n < 1)
+                return {};
+            var temp = {i: "ab" + i + (i / 100000)};
+            temp += "foo";
+            gcRec(n-1);
+        }
+        for (var i = 0; i < 1000; i++)
+            gcRec(10)
     }
 }
 
@@ -24,7 +32,7 @@ function waitUntilThreadCountMatches(callback, count)
 {
     // When running in a browser, just wait for one second then call the callback.
     if (!window.layoutTestController) {
-        setTimeout(function() { gc(); callback(); }, 1000);
+        setTimeout(function() { gc(true); callback(); }, 1000);
         return;
     }
 
@@ -33,7 +41,8 @@ function waitUntilThreadCountMatches(callback, count)
         callback();
     } else {
         // Poll until worker threads have been GC'd/exited.
-        gc();
+        // Force a GC with a bunch of allocations to try to scramble the stack and force worker objects to be collected.
+        gc(true);
         setTimeout(function() { waitUntilThreadCountMatches(callback, count); }, 10);
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list