Don't throw away code when JSGarbageCollect API is called
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jul 2011 21:07:41 +0000 (21:07 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jul 2011 21:07:41 +0000 (21:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64894

Reviewed by Sam Weinig.

Just call collectAllGarbage.  That will clean up all unneeded
code without causing any pathological recompilation problems.

* API/JSBase.cpp:
(JSGarbageCollect):

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

Source/JavaScriptCore/API/JSBase.cpp
Source/JavaScriptCore/ChangeLog

index da88a60..c5f1b15 100644 (file)
@@ -97,10 +97,8 @@ void JSGarbageCollect(JSContextRef ctx)
     APIEntryShim entryShim(exec, false);
 
     JSGlobalData& globalData = exec->globalData();
-    if (!globalData.heap.isBusy()) {
-        // releaseExecutableMemory forces a full GC
-        globalData.releaseExecutableMemory();
-    }
+    if (!globalData.heap.isBusy())
+        globalData.heap.collectAllGarbage();
 
     // FIXME: Perhaps we should trigger a second mark and sweep
     // once the garbage collector is done if this is called when
index 903a740..13ae4c8 100644 (file)
@@ -1,5 +1,18 @@
 2011-07-20  Oliver Hunt  <oliver@apple.com>
 
+        Don't throw away code when JSGarbageCollect API is called
+        https://bugs.webkit.org/show_bug.cgi?id=64894
+
+        Reviewed by Sam Weinig.
+
+        Just call collectAllGarbage.  That will clean up all unneeded
+        code without causing any pathological recompilation problems.
+
+        * API/JSBase.cpp:
+        (JSGarbageCollect):
+
+2011-07-20  Oliver Hunt  <oliver@apple.com>
+
         Codeblock doesn't visit cached structures in global resolve instructions
         https://bugs.webkit.org/show_bug.cgi?id=64889