[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:38:09 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3a8d9fa5cc1541643a1e539c497585b17d21fbe3
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Apr 23 00:09:32 2003 +0000

            Reviewed by Ken.
    
    	Improved List pool for 3% speed improvement on cvs-js-ibench
    
            * kjs/list.cpp: Replaced the roving cursor with a free list and
    	raised the high water mark to 384.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 74d8c4d..14ff70a 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,12 @@
+2003-04-18  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Ken.
+
+	Improved List pool for 3% speed improvement on cvs-js-ibench
+
+        * kjs/list.cpp: Replaced the roving cursor with a free list and
+	raised the high water mark to 384.
+
 2003-04-12  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Don.
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index 74d8c4d..14ff70a 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,12 @@
+2003-04-18  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Ken.
+
+	Improved List pool for 3% speed improvement on cvs-js-ibench
+
+        * kjs/list.cpp: Replaced the roving cursor with a free list and
+	raised the high water mark to 384.
+
 2003-04-12  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Don.
diff --git a/JavaScriptCore/kjs/list.cpp b/JavaScriptCore/kjs/list.cpp
index 30bf668..1444807 100644
--- a/JavaScriptCore/kjs/list.cpp
+++ b/JavaScriptCore/kjs/list.cpp
@@ -28,11 +28,9 @@
 namespace KJS {
 
 // tunable parameters
-const int poolSize = 32; // must be a power of 2
+const int poolSize = 384;
 const int inlineValuesSize = 4;
 
-// derived constants
-const int poolSizeMask = poolSize - 1;
 
 enum ListImpState { unusedInPool = 0, usedInPool, usedOnHeap, immortal };
 
@@ -43,13 +41,16 @@ struct ListImp : ListImpBase
     int capacity;
     ValueImp **overflow;
 
+    ListImp *nextInFreeList;
+
 #if DUMP_STATISTICS
     int sizeHighWaterMark;
 #endif
 };
 
 static ListImp pool[poolSize];
-static int poolCursor;
+static ListImp *poolFreeList;
+static int poolUsed;
 
 #if DUMP_STATISTICS
 
@@ -88,18 +89,13 @@ ListStatisticsExitLogger::~ListStatisticsExitLogger()
 static inline ListImp *allocateListImp()
 {
     // Find a free one in the pool.
-    int c = poolCursor;
-    int i = c;
-    do {
-        ListImp *imp = &pool[i];
-        ListImpState s = imp->state;
-        i = (i + 1) & poolSizeMask;
-        if (s == unusedInPool) {
-            poolCursor = i;
-            imp->state = usedInPool;
-            return imp;
-        }
-    } while (i != c);
+    if (poolUsed < poolSize) {
+	ListImp *imp = poolFreeList ? poolFreeList : &pool[0];
+	poolFreeList = imp->nextInFreeList ? imp->nextInFreeList : imp + 1;
+	imp->state = usedInPool;
+	poolUsed++;
+	return imp;
+    }
     
     ListImp *imp = new ListImp;
     imp->state = usedOnHeap;
@@ -108,10 +104,14 @@ static inline ListImp *allocateListImp()
 
 static inline void deallocateListImp(ListImp *imp)
 {
-    if (imp->state == usedInPool)
+    if (imp->state == usedInPool) {
         imp->state = unusedInPool;
-    else
+	imp->nextInFreeList = poolFreeList;
+	poolFreeList = imp;
+	poolUsed--;
+    } else {
         delete imp;
+    }
 }
 
 List::List() : _impBase(allocateListImp()), _needsMarking(false)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list