[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:04:52 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 3d0d1816cad08c5f237f5b78df82acc3a3b7072b
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 20 16:54:45 2002 +0000
Fixed the two most obvious problems with the new GC for another 6%
improvement.
* kjs/collector.cpp:
(Collector::allocate): Don't bother doing the bit tests on a bitmap word if
all it's bits are on.
(Collector::collect): Track memoryFull boolean.
* kjs/collector.h: Inlined outOfMemory since it was showing up on profiles.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 57f3c26..1895f7f 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,16 @@
2002-11-20 Maciej Stachowiak <mjs at apple.com>
+ Fixed the two most obvious problems with the new GC for another 6%
+ improvement.
+
+ * kjs/collector.cpp:
+ (Collector::allocate): Don't bother doing the bit tests on a bitmap word if
+ all it's bits are on.
+ (Collector::collect): Track memoryFull boolean.
+ * kjs/collector.h: Inlined outOfMemory since it was showing up on profiles.
+
+2002-11-20 Maciej Stachowiak <mjs at apple.com>
+
Rewrote garbage collector to make blocks of actual memory instead
of blocks of pointers. 7% improvement on JavaScript
iBench. There's still lots of room to tune the new GC, this is
diff --git a/JavaScriptCore/ChangeLog-2002-12-03 b/JavaScriptCore/ChangeLog-2002-12-03
index 57f3c26..1895f7f 100644
--- a/JavaScriptCore/ChangeLog-2002-12-03
+++ b/JavaScriptCore/ChangeLog-2002-12-03
@@ -1,5 +1,16 @@
2002-11-20 Maciej Stachowiak <mjs at apple.com>
+ Fixed the two most obvious problems with the new GC for another 6%
+ improvement.
+
+ * kjs/collector.cpp:
+ (Collector::allocate): Don't bother doing the bit tests on a bitmap word if
+ all it's bits are on.
+ (Collector::collect): Track memoryFull boolean.
+ * kjs/collector.h: Inlined outOfMemory since it was showing up on profiles.
+
+2002-11-20 Maciej Stachowiak <mjs at apple.com>
+
Rewrote garbage collector to make blocks of actual memory instead
of blocks of pointers. 7% improvement on JavaScript
iBench. There's still lots of room to tune the new GC, this is
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index 57f3c26..1895f7f 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,5 +1,16 @@
2002-11-20 Maciej Stachowiak <mjs at apple.com>
+ Fixed the two most obvious problems with the new GC for another 6%
+ improvement.
+
+ * kjs/collector.cpp:
+ (Collector::allocate): Don't bother doing the bit tests on a bitmap word if
+ all it's bits are on.
+ (Collector::collect): Track memoryFull boolean.
+ * kjs/collector.h: Inlined outOfMemory since it was showing up on profiles.
+
+2002-11-20 Maciej Stachowiak <mjs at apple.com>
+
Rewrote garbage collector to make blocks of actual memory instead
of blocks of pointers. 7% improvement on JavaScript
iBench. There's still lots of room to tune the new GC, this is
diff --git a/JavaScriptCore/kjs/collector.cpp b/JavaScriptCore/kjs/collector.cpp
index 971a339..c350fb4 100644
--- a/JavaScriptCore/kjs/collector.cpp
+++ b/JavaScriptCore/kjs/collector.cpp
@@ -43,6 +43,7 @@ static const int LOW_WATER_FACTOR = 4;
// derived constants
static const int WORD_SIZE = sizeof(uint32_t);
static const int BITS_PER_WORD = WORD_SIZE * 8;
+static const uint32_t ALL_BITS_ON = 0xffffffff;
static const int CELLS_PER_BLOCK = ((BLOCK_SIZE * 8 - 32) / (CELL_SIZE * 8 + 1));
static const int BITMAP_SIZE = (CELLS_PER_BLOCK / BITS_PER_WORD) + (CELLS_PER_BLOCK % BITS_PER_WORD != 0 ? 1 : 0);
@@ -76,6 +77,9 @@ struct CollectorHeap {
static CollectorHeap heap = {NULL, 0, 0, NULL, 0, 0, 0, 0};
+bool Collector::memoryFull = false;
+
+
void* Collector::allocate(size_t s)
{
if (s == 0)
@@ -85,13 +89,6 @@ void* Collector::allocate(size_t s)
if (++heap.numAllocationsSinceLastCollect >= ALLOCATIONS_PER_COLLECTION)
collect();
- heap.numLiveObjects++;
-
- if (heap.numLiveObjects >= KJS_MEM_LIMIT) {
- // fprintf(stderr,"Out of memory");
- }
-
-
if (s > (unsigned)CELL_SIZE) {
// oversize allocator
if (heap.usedOversizeCells == heap.numOversizeCells) {
@@ -134,6 +131,9 @@ void* Collector::allocate(size_t s)
// find a free spot in the block
for (int wordInBitmap = 0; wordInBitmap < BITMAP_SIZE; wordInBitmap++) {
uint32_t word = targetBlock->bitmap[wordInBitmap];
+ if (word == ALL_BITS_ON) {
+ continue;
+ }
for (int bitInWord = 0; bitInWord < BITS_PER_WORD; bitInWord++) {
if ((word & (1 << bitInWord)) == 0) {
int cellPos = BITS_PER_WORD * wordInBitmap + bitInWord;
@@ -275,6 +275,8 @@ bool Collector::collect()
heap.numAllocationsSinceLastCollect = 0;
+ memoryFull = (heap.numLiveObjects >= KJS_MEM_LIMIT);
+
return deleted;
}
@@ -283,11 +285,6 @@ int Collector::size()
return heap.numLiveObjects;
}
-bool Collector::outOfMemory()
-{
- return heap.numLiveObjects >= KJS_MEM_LIMIT;
-}
-
#ifdef KJS_DEBUG_MEM
void Collector::finalCheck()
{
diff --git a/JavaScriptCore/kjs/collector.h b/JavaScriptCore/kjs/collector.h
index ad7712c..1708e41 100644
--- a/JavaScriptCore/kjs/collector.h
+++ b/JavaScriptCore/kjs/collector.h
@@ -57,7 +57,7 @@ namespace KJS {
*/
static bool collect();
static int size();
- static bool outOfMemory();
+ static bool outOfMemory() { return memoryFull; }
#ifdef KJS_DEBUG_MEM
/**
@@ -72,6 +72,8 @@ namespace KJS {
static int numReferencedObjects();
static CFSetRef liveObjectClasses();
#endif
+ private:
+ static bool memoryFull;
};
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list