Title: [178522] trunk/Source/WebCore
Revision
178522
Author
[email protected]
Date
2015-01-15 12:07:47 -0800 (Thu, 15 Jan 2015)

Log Message

REGRESSION(r178133): Membuster regressed ~4%
https://bugs.webkit.org/show_bug.cgi?id=140495

Reviewed by Andreas Kling.

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontData):

    Fonts may ref other fonts. Keep clearing until there are no changes.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (178521 => 178522)


--- trunk/Source/WebCore/ChangeLog	2015-01-15 19:54:42 UTC (rev 178521)
+++ trunk/Source/WebCore/ChangeLog	2015-01-15 20:07:47 UTC (rev 178522)
@@ -1,3 +1,15 @@
+2015-01-15  Antti Koivisto  <[email protected]>
+
+        REGRESSION(r178133): Membuster regressed ~4%
+        https://bugs.webkit.org/show_bug.cgi?id=140495
+
+        Reviewed by Andreas Kling.
+
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::purgeInactiveFontData):
+
+            Fonts may ref other fonts. Keep clearing until there are no changes.
+
 2015-01-15  Brent Fulgham  <[email protected]>
 
         [Win] Unreviewed build fix.

Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (178521 => 178522)


--- trunk/Source/WebCore/platform/graphics/FontCache.cpp	2015-01-15 19:54:42 UTC (rev 178521)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp	2015-01-15 20:07:47 UTC (rev 178522)
@@ -432,16 +432,21 @@
     FontLocker fontLocker;
 #endif
 
-    Vector<RefPtr<SimpleFontData>, 20> fontsToDelete;
-    for (auto& font : cachedFonts().values()) {
-        if (!font->hasOneRef())
-            continue;
-        fontsToDelete.append(WTF::move(font));
-        if (!--purgeCount)
+    while (purgeCount) {
+        Vector<RefPtr<SimpleFontData>, 20> fontsToDelete;
+        for (auto& font : cachedFonts().values()) {
+            if (!font->hasOneRef())
+                continue;
+            fontsToDelete.append(WTF::move(font));
+            if (!--purgeCount)
+                break;
+        }
+        // Fonts may ref other fonts so we loop until there are no changes.
+        if (fontsToDelete.isEmpty())
             break;
-    }
-    for (auto& font : fontsToDelete)
-        cachedFonts().remove(font->platformData());
+        for (auto& font : fontsToDelete)
+            cachedFonts().remove(font->platformData());
+    };
 
     Vector<FontPlatformDataCacheKey> keysToRemove;
     keysToRemove.reserveInitialCapacity(fontPlatformDataCache().size());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to