[webkit-changes] cvs commit: WebKit/WebView.subproj
WebPreferences.m WebPreferencesPrivate.h
Adele
adele at opensource.apple.com
Tue Sep 27 19:25:59 PDT 2005
adele 05/09/27 19:25:58
Modified: . ChangeLog
kjs collector.cpp collector.h
. ChangeLog
kwq WebCoreJavaScript.h WebCoreJavaScript.mm
. ChangeLog
Misc.subproj WebCoreStatistics.h WebCoreStatistics.m
WebView.subproj WebPreferences.m WebPreferencesPrivate.h
Log:
JavaScriptCore:
Reviewed by Maciej.
Changed ints to size_t where appropriate.
* kjs/collector.cpp:
(KJS::Collector::allocate):
(KJS::Collector::markStackObjectsConservatively):
(KJS::Collector::collect):
(KJS::Collector::size):
(KJS::Collector::numInterpreters):
(KJS::Collector::numGCNotAllowedObjects):
(KJS::Collector::numReferencedObjects):
* kjs/collector.h:
WebCore:
Reviewed by Maciej.
Changing ints to size_t where appropriate.
* kwq/WebCoreJavaScript.h:
* kwq/WebCoreJavaScript.mm:
(+[WebCoreJavaScript objectCount]):
(+[WebCoreJavaScript interpreterCount]):
(+[WebCoreJavaScript noGCAllowedObjectCount]):
(+[WebCoreJavaScript referencedObjectCount]):
WebKit:
Reviewed by Maciej.
Changed ints to size_t where appropriate.
* Misc.subproj/WebCoreStatistics.h:
* Misc.subproj/WebCoreStatistics.m:
(+[WebCoreStatistics javaScriptObjectsCount]):
(+[WebCoreStatistics javaScriptInterpretersCount]):
(+[WebCoreStatistics javaScriptNoGCAllowedObjectsCount]):
(+[WebCoreStatistics javaScriptReferencedObjectsCount]):
* WebView.subproj/WebPreferences.m:
(-[WebPreferences _pageCacheSize]):
(-[WebPreferences _objectCacheSize]):
* WebView.subproj/WebPreferencesPrivate.h:
Revision Changes Path
1.841 +16 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.840
retrieving revision 1.841
diff -u -r1.840 -r1.841
--- ChangeLog 28 Sep 2005 00:07:28 -0000 1.840
+++ ChangeLog 28 Sep 2005 02:25:48 -0000 1.841
@@ -1,3 +1,19 @@
+2005-09-27 Adele Peterson <adele at apple.com>
+
+ Reviewed by Maciej.
+
+ Changed ints to size_t where appropriate.
+
+ * kjs/collector.cpp:
+ (KJS::Collector::allocate):
+ (KJS::Collector::markStackObjectsConservatively):
+ (KJS::Collector::collect):
+ (KJS::Collector::size):
+ (KJS::Collector::numInterpreters):
+ (KJS::Collector::numGCNotAllowedObjects):
+ (KJS::Collector::numReferencedObjects):
+ * kjs/collector.h:
+
2005-09-27 Eric Seidel <eseidel at apple.com>
Reviewed by kevin.
1.47 +48 -48 JavaScriptCore/kjs/collector.cpp
Index: collector.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/collector.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- collector.cpp 27 Sep 2005 22:36:48 -0000 1.46
+++ collector.cpp 28 Sep 2005 02:25:49 -0000 1.47
@@ -48,18 +48,18 @@
namespace KJS {
// tunable parameters
-const int MINIMUM_CELL_SIZE = 56;
-const int BLOCK_SIZE = (8 * 4096);
-const int SPARE_EMPTY_BLOCKS = 2;
-const int MIN_ARRAY_SIZE = 14;
-const int GROWTH_FACTOR = 2;
-const int LOW_WATER_FACTOR = 4;
-const int ALLOCATIONS_PER_COLLECTION = 1000;
+const size_t MINIMUM_CELL_SIZE = 56;
+const size_t BLOCK_SIZE = (8 * 4096);
+const size_t SPARE_EMPTY_BLOCKS = 2;
+const size_t MIN_ARRAY_SIZE = 14;
+const size_t GROWTH_FACTOR = 2;
+const size_t LOW_WATER_FACTOR = 4;
+const size_t ALLOCATIONS_PER_COLLECTION = 1000;
// derived constants
-const int CELL_ARRAY_LENGTH = (MINIMUM_CELL_SIZE / sizeof(double)) + (MINIMUM_CELL_SIZE % sizeof(double) != 0 ? sizeof(double) : 0);
-const int CELL_SIZE = CELL_ARRAY_LENGTH * sizeof(double);
-const int CELLS_PER_BLOCK = ((BLOCK_SIZE * 8 - sizeof(int32_t) * 8 - sizeof(void *) * 8) / (CELL_SIZE * 8));
+const size_t CELL_ARRAY_LENGTH = (MINIMUM_CELL_SIZE / sizeof(double)) + (MINIMUM_CELL_SIZE % sizeof(double) != 0 ? sizeof(double) : 0);
+const size_t CELL_SIZE = CELL_ARRAY_LENGTH * sizeof(double);
+const size_t CELLS_PER_BLOCK = ((BLOCK_SIZE * 8 - sizeof(uint32_t) * 8 - sizeof(void *) * 8) / (CELL_SIZE * 8));
@@ -76,22 +76,22 @@
struct CollectorBlock {
CollectorCell cells[CELLS_PER_BLOCK];
- int32_t usedCells;
+ uint32_t usedCells;
CollectorCell *freeList;
};
struct CollectorHeap {
CollectorBlock **blocks;
- int numBlocks;
- int usedBlocks;
- int firstBlockWithPossibleSpace;
+ size_t numBlocks;
+ size_t usedBlocks;
+ size_t firstBlockWithPossibleSpace;
CollectorCell **oversizeCells;
- int numOversizeCells;
- int usedOversizeCells;
+ size_t numOversizeCells;
+ size_t usedOversizeCells;
- int numLiveObjects;
- int numLiveObjectsAtLastCollect;
+ size_t numLiveObjects;
+ size_t numLiveObjectsAtLastCollect;
};
static CollectorHeap heap = {NULL, 0, 0, 0, NULL, 0, 0, 0, 0};
@@ -103,17 +103,17 @@
assert(Interpreter::lockCount() > 0);
// collect if needed
- int numLiveObjects = heap.numLiveObjects;
+ size_t numLiveObjects = heap.numLiveObjects;
if (numLiveObjects - heap.numLiveObjectsAtLastCollect >= ALLOCATIONS_PER_COLLECTION) {
collect();
numLiveObjects = heap.numLiveObjects;
}
- if (s > static_cast<size_t>(CELL_SIZE)) {
+ if (s > CELL_SIZE) {
// oversize allocator
- int usedOversizeCells = heap.usedOversizeCells;
- int numOversizeCells = heap.numOversizeCells;
+ size_t usedOversizeCells = heap.usedOversizeCells;
+ size_t numOversizeCells = heap.numOversizeCells;
if (usedOversizeCells == numOversizeCells) {
numOversizeCells = max(MIN_ARRAY_SIZE, numOversizeCells * GROWTH_FACTOR);
@@ -131,11 +131,11 @@
// slab allocator
- int usedBlocks = heap.usedBlocks;
+ size_t usedBlocks = heap.usedBlocks;
- int i = heap.firstBlockWithPossibleSpace;
+ size_t i = heap.firstBlockWithPossibleSpace;
CollectorBlock *targetBlock;
- int targetBlockUsedCells;
+ size_t targetBlockUsedCells;
if (i != usedBlocks) {
targetBlock = heap.blocks[i];
targetBlockUsedCells = targetBlock->usedCells;
@@ -152,7 +152,7 @@
allocateNewBlock:
// didn't find one, need to allocate a new block
- int numBlocks = heap.numBlocks;
+ size_t numBlocks = heap.numBlocks;
if (usedBlocks == numBlocks) {
numBlocks = max(MIN_ARRAY_SIZE, numBlocks * GROWTH_FACTOR);
heap.numBlocks = numBlocks;
@@ -233,10 +233,10 @@
#endif
-#define IS_POINTER_ALIGNED(p) (((int)(p) & (sizeof(char *) - 1)) == 0)
+#define IS_POINTER_ALIGNED(p) (((intptr_t)(p) & (sizeof(char *) - 1)) == 0)
// cells are 8-byte aligned
-#define IS_CELL_ALIGNED(p) (((int)(p) & 7) == 0)
+#define IS_CELL_ALIGNED(p) (((intptr_t)(p) & 7) == 0)
void Collector::markStackObjectsConservatively(void *start, void *end)
{
@@ -253,9 +253,9 @@
char **p = (char **)start;
char **e = (char **)end;
- int usedBlocks = heap.usedBlocks;
+ size_t usedBlocks = heap.usedBlocks;
CollectorBlock **blocks = heap.blocks;
- int usedOversizeCells = heap.usedOversizeCells;
+ size_t usedOversizeCells = heap.usedOversizeCells;
CollectorCell **oversizeCells = heap.oversizeCells;
const size_t lastCellOffset = sizeof(CollectorCell) * (CELLS_PER_BLOCK - 1);
@@ -263,12 +263,12 @@
while (p != e) {
char *x = *p++;
if (IS_CELL_ALIGNED(x) && x) {
- for (int block = 0; block < usedBlocks; block++) {
+ for (size_t block = 0; block < usedBlocks; block++) {
size_t offset = x - reinterpret_cast<char *>(blocks[block]);
if (offset <= lastCellOffset && offset % sizeof(CollectorCell) == 0)
goto gotGoodPointer;
}
- for (int i = 0; i != usedOversizeCells; i++)
+ for (size_t i = 0; i != usedOversizeCells; i++)
if (x == reinterpret_cast<char *>(oversizeCells[i]))
goto gotGoodPointer;
continue;
@@ -396,18 +396,18 @@
// SWEEP: delete everything with a zero refcount (garbage) and unmark everything else
- int emptyBlocks = 0;
- int numLiveObjects = heap.numLiveObjects;
+ size_t emptyBlocks = 0;
+ size_t numLiveObjects = heap.numLiveObjects;
- for (int block = 0; block < heap.usedBlocks; block++) {
+ for (size_t block = 0; block < heap.usedBlocks; block++) {
CollectorBlock *curBlock = heap.blocks[block];
- int usedCells = curBlock->usedCells;
+ size_t usedCells = curBlock->usedCells;
CollectorCell *freeList = curBlock->freeList;
if (usedCells == CELLS_PER_BLOCK) {
// special case with a block where all cells are used -- testing indicates this happens often
- for (int i = 0; i < CELLS_PER_BLOCK; i++) {
+ for (size_t i = 0; i < CELLS_PER_BLOCK; i++) {
CollectorCell *cell = curBlock->cells + i;
AllocatedValueImp *imp = reinterpret_cast<AllocatedValueImp *>(cell);
if (imp->m_marked) {
@@ -424,8 +424,8 @@
}
}
} else {
- int minimumCellsToProcess = usedCells;
- for (int i = 0; i < minimumCellsToProcess; i++) {
+ size_t minimumCellsToProcess = usedCells;
+ for (size_t i = 0; i < minimumCellsToProcess; i++) {
CollectorCell *cell = curBlock->cells + i;
if (cell->u.freeCell.zeroIfFree == 0) {
++minimumCellsToProcess;
@@ -472,7 +472,7 @@
if (heap.numLiveObjects != numLiveObjects)
heap.firstBlockWithPossibleSpace = 0;
- int cell = 0;
+ size_t cell = 0;
while (cell < heap.usedOversizeCells) {
AllocatedValueImp *imp = (AllocatedValueImp *)heap.oversizeCells[cell];
@@ -510,7 +510,7 @@
return deleted;
}
-int Collector::size()
+size_t Collector::size()
{
return heap.numLiveObjects;
}
@@ -521,9 +521,9 @@
}
#endif
-int Collector::numInterpreters()
+size_t Collector::numInterpreters()
{
- int count = 0;
+ size_t count = 0;
if (InterpreterImp::s_hook) {
InterpreterImp *scr = InterpreterImp::s_hook;
do {
@@ -534,18 +534,18 @@
return count;
}
-int Collector::numGCNotAllowedObjects()
+size_t Collector::numGCNotAllowedObjects()
{
return 0;
}
-int Collector::numReferencedObjects()
+size_t Collector::numReferencedObjects()
{
- int count = 0;
+ size_t count = 0;
- int size = ProtectedValues::_tableSize;
+ size_t size = ProtectedValues::_tableSize;
ProtectedValues::KeyValue *table = ProtectedValues::_table;
- for (int i = 0; i < size; i++) {
+ for (size_t i = 0; i < size; i++) {
AllocatedValueImp *val = table[i].key;
if (val) {
++count;
1.20 +4 -4 JavaScriptCore/kjs/collector.h
Index: collector.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/collector.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- collector.h 14 Jul 2005 18:27:01 -0000 1.19
+++ collector.h 28 Sep 2005 02:25:49 -0000 1.20
@@ -53,7 +53,7 @@
* on each object and freeing the used memory.
*/
static bool collect();
- static int size();
+ static size_t size();
static bool outOfMemory() { return memoryFull; }
#ifdef KJS_DEBUG_MEM
@@ -63,9 +63,9 @@
static void finalCheck();
#endif
- static int numInterpreters();
- static int numGCNotAllowedObjects();
- static int numReferencedObjects();
+ static size_t numInterpreters();
+ static size_t numGCNotAllowedObjects();
+ static size_t numReferencedObjects();
#if APPLE_CHANGES
static const void *rootObjectClasses(); // actually returns CFSetRef
#endif
1.170 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -r1.169 -r1.170
--- ChangeLog 28 Sep 2005 00:49:29 -0000 1.169
+++ ChangeLog 28 Sep 2005 02:25:50 -0000 1.170
@@ -1,3 +1,16 @@
+2005-09-27 Adele Peterson <adele at apple.com>
+
+ Reviewed by Maciej.
+
+ Changing ints to size_t where appropriate.
+
+ * kwq/WebCoreJavaScript.h:
+ * kwq/WebCoreJavaScript.mm:
+ (+[WebCoreJavaScript objectCount]):
+ (+[WebCoreJavaScript interpreterCount]):
+ (+[WebCoreJavaScript noGCAllowedObjectCount]):
+ (+[WebCoreJavaScript referencedObjectCount]):
+
2005-09-27 Eric Seidel <eseidel at apple.com>
No review necessary, SVG build fix only.
1.7 +4 -4 WebCore/kwq/WebCoreJavaScript.h
Index: WebCoreJavaScript.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreJavaScript.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- WebCoreJavaScript.h 13 May 2003 21:19:56 -0000 1.6
+++ WebCoreJavaScript.h 28 Sep 2005 02:25:52 -0000 1.7
@@ -29,11 +29,11 @@
{
}
-+ (int)interpreterCount;
++ (size_t)interpreterCount;
-+ (int)objectCount;
-+ (int)noGCAllowedObjectCount;
-+ (int)referencedObjectCount;
++ (size_t)objectCount;
++ (size_t)noGCAllowedObjectCount;
++ (size_t)referencedObjectCount;
+ (NSSet *)rootObjectClasses;
+ (void)garbageCollect;
1.9 +4 -4 WebCore/kwq/WebCoreJavaScript.mm
Index: WebCoreJavaScript.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/WebCoreJavaScript.mm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- WebCoreJavaScript.mm 19 Sep 2005 18:52:13 -0000 1.8
+++ WebCoreJavaScript.mm 28 Sep 2005 02:25:52 -0000 1.9
@@ -34,22 +34,22 @@
@implementation WebCoreJavaScript
-+ (int)objectCount
++ (size_t)objectCount
{
return Collector::size();
}
-+ (int)interpreterCount
++ (size_t)interpreterCount
{
return Collector::numInterpreters();
}
-+ (int)noGCAllowedObjectCount
++ (size_t)noGCAllowedObjectCount
{
return Collector::numGCNotAllowedObjects();
}
-+ (int)referencedObjectCount
++ (size_t)referencedObjectCount
{
return Collector::numReferencedObjects();
}
1.3334 +17 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3333
retrieving revision 1.3334
diff -u -r1.3333 -r1.3334
--- ChangeLog 26 Sep 2005 19:06:57 -0000 1.3333
+++ ChangeLog 28 Sep 2005 02:25:53 -0000 1.3334
@@ -1,3 +1,20 @@
+2005-09-27 Adele Peterson <adele at apple.com>
+
+ Reviewed by Maciej.
+
+ Changed ints to size_t where appropriate.
+
+ * Misc.subproj/WebCoreStatistics.h:
+ * Misc.subproj/WebCoreStatistics.m:
+ (+[WebCoreStatistics javaScriptObjectsCount]):
+ (+[WebCoreStatistics javaScriptInterpretersCount]):
+ (+[WebCoreStatistics javaScriptNoGCAllowedObjectsCount]):
+ (+[WebCoreStatistics javaScriptReferencedObjectsCount]):
+ * WebView.subproj/WebPreferences.m:
+ (-[WebPreferences _pageCacheSize]):
+ (-[WebPreferences _objectCacheSize]):
+ * WebView.subproj/WebPreferencesPrivate.h:
+
2005-09-26 John Sullivan <sullivan at apple.com>
Reviewed by Tim Omernick.
1.12 +4 -4 WebKit/Misc.subproj/WebCoreStatistics.h
Index: WebCoreStatistics.h
===================================================================
RCS file: /cvs/root/WebKit/Misc.subproj/WebCoreStatistics.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- WebCoreStatistics.h 5 Jun 2005 17:54:25 -0000 1.11
+++ WebCoreStatistics.h 28 Sep 2005 02:25:57 -0000 1.12
@@ -38,10 +38,10 @@
+ (void)emptyCache;
+ (void)setCacheDisabled:(BOOL)disabled;
-+ (int)javaScriptObjectsCount;
-+ (int)javaScriptInterpretersCount;
-+ (int)javaScriptNoGCAllowedObjectsCount;
-+ (int)javaScriptReferencedObjectsCount;
++ (size_t)javaScriptObjectsCount;
++ (size_t)javaScriptInterpretersCount;
++ (size_t)javaScriptNoGCAllowedObjectsCount;
++ (size_t)javaScriptReferencedObjectsCount;
+ (NSSet *)javaScriptRootObjectClasses;
+ (void)garbageCollectJavaScriptObjects;
1.14 +4 -4 WebKit/Misc.subproj/WebCoreStatistics.m
Index: WebCoreStatistics.m
===================================================================
RCS file: /cvs/root/WebKit/Misc.subproj/WebCoreStatistics.m,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- WebCoreStatistics.m 5 Jun 2005 17:54:25 -0000 1.13
+++ WebCoreStatistics.m 28 Sep 2005 02:25:57 -0000 1.14
@@ -51,22 +51,22 @@
[WebCoreCache setDisabled:disabled];
}
-+ (int)javaScriptObjectsCount
++ (size_t)javaScriptObjectsCount
{
return [WebCoreJavaScript objectCount];
}
-+ (int)javaScriptInterpretersCount
++ (size_t)javaScriptInterpretersCount
{
return [WebCoreJavaScript interpreterCount];
}
-+ (int)javaScriptNoGCAllowedObjectsCount
++ (size_t)javaScriptNoGCAllowedObjectsCount
{
return [WebCoreJavaScript noGCAllowedObjectCount];
}
-+ (int)javaScriptReferencedObjectsCount
++ (size_t)javaScriptReferencedObjectsCount
{
return [WebCoreJavaScript referencedObjectCount];
}
1.99 +2 -2 WebKit/WebView.subproj/WebPreferences.m
Index: WebPreferences.m
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebPreferences.m,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- WebPreferences.m 6 Sep 2005 21:40:13 -0000 1.98
+++ WebPreferences.m 28 Sep 2005 02:25:58 -0000 1.99
@@ -618,12 +618,12 @@
[self _setBoolValue: flag forKey: WebKitTextAreasAreResizablePreferenceKey];
}
-- (int)_pageCacheSize
+- (size_t)_pageCacheSize
{
return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitPageCacheSizePreferenceKey];
}
-- (int)_objectCacheSize
+- (size_t)_objectCacheSize
{
return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitObjectCacheSizePreferenceKey];
}
1.28 +2 -2 WebKit/WebView.subproj/WebPreferencesPrivate.h
Index: WebPreferencesPrivate.h
===================================================================
RCS file: /cvs/root/WebKit/WebView.subproj/WebPreferencesPrivate.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- WebPreferencesPrivate.h 1 Aug 2005 17:50:35 -0000 1.27
+++ WebPreferencesPrivate.h 28 Sep 2005 02:25:58 -0000 1.28
@@ -54,8 +54,8 @@
- (void)setPDFScaleFactor:(float)scale;
// Other private methods
-- (int)_pageCacheSize;
-- (int)_objectCacheSize;
+- (size_t)_pageCacheSize;
+- (size_t)_objectCacheSize;
- (void)_postPreferencesChangesNotification;
+ (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
+ (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
More information about the webkit-changes
mailing list