Bug 1103173 - Avoid a lock/unlock pair if there are no Chunks to expire; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Fri, 21 Nov 2014 17:19:48 -0800
changeset 241301 f440594be934055df8c919fda84f06643d1664e6
parent 241300 e33876e4431eb557c7198440d2166320373a3d35
child 241302 35dfe1a7ed6a3ad4036cf36f1f16172f73428826
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1103173
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1103173 - Avoid a lock/unlock pair if there are no Chunks to expire; r=sfink
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -3425,17 +3425,17 @@ GCRuntime::decommitArenas(AutoLockGC &lo
 void
 GCRuntime::expireChunksAndArenas(bool shouldShrink, AutoLockGC &lock)
 {
 #ifdef JSGC_FJGENERATIONAL
     rt->threadPool.pruneChunkCache();
 #endif
 
     ChunkPool toFree = expireEmptyChunkPool(shouldShrink, lock);
-    {
+    if (toFree.count()) {
         AutoUnlockGC unlock(lock);
         FreeChunkPool(rt, toFree);
     }
 
     if (shouldShrink)
         decommitArenas(lock);
 }