Don't clear the weak JSString cache on memory pressure.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Feb 2016 23:24:41 +0000 (23:24 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Feb 2016 23:24:41 +0000 (23:24 +0000)
<https://webkit.org/b/154693>

Reviewed by Antti Koivisto.

This was stupid. The cache is a WeakGCMap, so all the JSStrings pointed to are
still alive anyway. This way we keep the ability to deduplicate common strings.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory): Deleted.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/MemoryPressureHandler.cpp

index 3516a36..186bdaa 100644 (file)
@@ -1,3 +1,16 @@
+2016-02-25  Andreas Kling  <akling@apple.com>
+
+        Don't clear the weak JSString cache on memory pressure.
+        <https://webkit.org/b/154693>
+
+        Reviewed by Antti Koivisto.
+
+        This was stupid. The cache is a WeakGCMap, so all the JSStrings pointed to are
+        still alive anyway. This way we keep the ability to deduplicate common strings.
+
+        * platform/MemoryPressureHandler.cpp:
+        (WebCore::MemoryPressureHandler::releaseNoncriticalMemory): Deleted.
+
 2016-02-25  Chris Dumez  <cdumez@apple.com>
 
         Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
index c8a7735..6601942 100644 (file)
@@ -96,11 +96,6 @@ void MemoryPressureHandler::releaseNoncriticalMemory()
     }
 
     {
-        ReliefLogger log("Clearing JS string cache");
-        JSDOMWindow::commonVM().stringCache.clear();
-    }
-
-    {
         ReliefLogger log("Prune MemoryCache dead resources");
         MemoryCache::singleton().pruneDeadResourcesToSize(0);
     }