[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:57:26 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 40be54f4217998b58f2f16c50578dac398c191df
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 14 03:09:44 2002 +0000
Updated debugging code. Disabled optimized QString::find.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index 9557cb4..6ed1589 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -67,15 +67,23 @@ const float LargeNumberForText = 1.0e7;
boundingRect.origin.y = 0;
boundingRect.size = boundingRectSize;
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+ accessCount++;
+#endif
+
return boundingRect;
}
#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (int)accessCount { return accessCount; }
+#endif
+
+#ifdef _DEBUG_LAYOUT_FRAGMENT
- (NSComparisonResult)compare: (id)val
{
- if ([val _accessCount] > _accessCount)
+ if ([val accessCount] > accessCount)
return NSOrderedDescending;
- else if ([val _accessCount] < _accessCount)
+ else if ([val accessCount] < accessCount)
return NSOrderedAscending;
return NSOrderedSame;
}
@@ -146,7 +154,7 @@ static NSMutableDictionary *metricsCache = nil;
for (i = 0; i < count; i++){
string = [stringKeys objectAtIndex: i];
fragment = [fragCache objectForKey: [stringKeys objectAtIndex: i]];
- fprintf (stdout, " %06d \"%s\"\n", [fragment _accessCount], [string cString]);
+ fprintf (stdout, " %06d \"%s\"\n", [fragment accessCount], [string cString]);
}
}
@@ -163,9 +171,9 @@ static NSMutableDictionary *metricsCache = nil;
for (i = 0; i < count; i++){
font = [fontKeys objectAtIndex: i];
layoutInfo = [metricsCache objectForKey: [fontKeys objectAtIndex: i]];
- fprintf (stdout, "Cache information for font %s %f (%d objects)\n", [[font displayName] cString],[font pointSize], [[layoutInfo _fragmentCache] count]);
- [KWQLayoutInfo _dumpLayoutCache: [layoutInfo _fragmentCache]];
- totalObjects += [[layoutInfo _fragmentCache] count];
+ fprintf (stdout, "Cache information for font %s %f (%d objects)\n", [[font displayName] cString],[font pointSize], [[[layoutInfo textStorage] fragmentCache] count]);
+ [KWQLayoutInfo _dumpLayoutCache: [[layoutInfo textStorage] fragmentCache]];
+ totalObjects += [[[layoutInfo textStorage] fragmentCache] count];
}
fprintf (stdout, "Total cached objects %d\n", totalObjects);
}
@@ -192,9 +200,6 @@ static NSMutableDictionary *metricsCache = nil;
[metricsCache setObject: info forKey: aFont];
}
-#ifdef _DEBUG_LAYOUT_FRAGMENT
-- (NSDictionary *)_fragmentCache { return fragmentCache; }
-#endif
- initWithFont: (NSFont *)aFont
{
diff --git a/WebCore/kwq/KWQMetrics.h b/WebCore/kwq/KWQMetrics.h
index 7f5f204..75c5ea4 100644
--- a/WebCore/kwq/KWQMetrics.h
+++ b/WebCore/kwq/KWQMetrics.h
@@ -53,6 +53,9 @@
{
NSSize boundingRectSize;
unsigned short glyphRangeLength; // Is location always zero? Only need length.
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+ int accessCount;
+#endif
}
@@ -61,6 +64,10 @@
- (void)setBoundingRectSize: (NSSize)s;
- (NSRect)boundingRect;
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (int)accessCount;
+#endif
+
@end
#endif
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 620ac82..d9a466e 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -546,7 +546,8 @@ int QString::find(const char *chs, int index, bool caseSensitive) const
if (index < 0) {
index += len;
}
- if (internalBuffer == 0){
+ //if (internalBuffer == 0){
+ if (1){
#ifdef DEBUG_FIND_COUNTER
findExpensiveCount++;
if (findCount % 500 == 0)
diff --git a/WebCore/kwq/KWQTextStorage.h b/WebCore/kwq/KWQTextStorage.h
index 0d8da50..bbb3ae4 100644
--- a/WebCore/kwq/KWQTextStorage.h
+++ b/WebCore/kwq/KWQTextStorage.h
@@ -45,4 +45,8 @@
- (void)setString: (NSString *)dString;
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (NSDictionary *)fragmentCache;
+#endif
+
@end
diff --git a/WebCore/kwq/KWQTextStorage.mm b/WebCore/kwq/KWQTextStorage.mm
index 3dffeaf..05ae66d 100644
--- a/WebCore/kwq/KWQTextStorage.mm
+++ b/WebCore/kwq/KWQTextStorage.mm
@@ -105,6 +105,10 @@
[super dealloc];
}
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (NSDictionary *)fragmentCache { return fragmentCache; }
+#endif
+
- (void)addLayoutManager:(id)obj {
_layoutManager = [obj retain];
[obj setTextStorage:self];
diff --git a/WebCore/src/kwq/KWQFontMetrics.mm b/WebCore/src/kwq/KWQFontMetrics.mm
index 9557cb4..6ed1589 100644
--- a/WebCore/src/kwq/KWQFontMetrics.mm
+++ b/WebCore/src/kwq/KWQFontMetrics.mm
@@ -67,15 +67,23 @@ const float LargeNumberForText = 1.0e7;
boundingRect.origin.y = 0;
boundingRect.size = boundingRectSize;
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+ accessCount++;
+#endif
+
return boundingRect;
}
#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (int)accessCount { return accessCount; }
+#endif
+
+#ifdef _DEBUG_LAYOUT_FRAGMENT
- (NSComparisonResult)compare: (id)val
{
- if ([val _accessCount] > _accessCount)
+ if ([val accessCount] > accessCount)
return NSOrderedDescending;
- else if ([val _accessCount] < _accessCount)
+ else if ([val accessCount] < accessCount)
return NSOrderedAscending;
return NSOrderedSame;
}
@@ -146,7 +154,7 @@ static NSMutableDictionary *metricsCache = nil;
for (i = 0; i < count; i++){
string = [stringKeys objectAtIndex: i];
fragment = [fragCache objectForKey: [stringKeys objectAtIndex: i]];
- fprintf (stdout, " %06d \"%s\"\n", [fragment _accessCount], [string cString]);
+ fprintf (stdout, " %06d \"%s\"\n", [fragment accessCount], [string cString]);
}
}
@@ -163,9 +171,9 @@ static NSMutableDictionary *metricsCache = nil;
for (i = 0; i < count; i++){
font = [fontKeys objectAtIndex: i];
layoutInfo = [metricsCache objectForKey: [fontKeys objectAtIndex: i]];
- fprintf (stdout, "Cache information for font %s %f (%d objects)\n", [[font displayName] cString],[font pointSize], [[layoutInfo _fragmentCache] count]);
- [KWQLayoutInfo _dumpLayoutCache: [layoutInfo _fragmentCache]];
- totalObjects += [[layoutInfo _fragmentCache] count];
+ fprintf (stdout, "Cache information for font %s %f (%d objects)\n", [[font displayName] cString],[font pointSize], [[[layoutInfo textStorage] fragmentCache] count]);
+ [KWQLayoutInfo _dumpLayoutCache: [[layoutInfo textStorage] fragmentCache]];
+ totalObjects += [[[layoutInfo textStorage] fragmentCache] count];
}
fprintf (stdout, "Total cached objects %d\n", totalObjects);
}
@@ -192,9 +200,6 @@ static NSMutableDictionary *metricsCache = nil;
[metricsCache setObject: info forKey: aFont];
}
-#ifdef _DEBUG_LAYOUT_FRAGMENT
-- (NSDictionary *)_fragmentCache { return fragmentCache; }
-#endif
- initWithFont: (NSFont *)aFont
{
diff --git a/WebCore/src/kwq/KWQMetrics.h b/WebCore/src/kwq/KWQMetrics.h
index 7f5f204..75c5ea4 100644
--- a/WebCore/src/kwq/KWQMetrics.h
+++ b/WebCore/src/kwq/KWQMetrics.h
@@ -53,6 +53,9 @@
{
NSSize boundingRectSize;
unsigned short glyphRangeLength; // Is location always zero? Only need length.
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+ int accessCount;
+#endif
}
@@ -61,6 +64,10 @@
- (void)setBoundingRectSize: (NSSize)s;
- (NSRect)boundingRect;
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (int)accessCount;
+#endif
+
@end
#endif
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index 620ac82..d9a466e 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -546,7 +546,8 @@ int QString::find(const char *chs, int index, bool caseSensitive) const
if (index < 0) {
index += len;
}
- if (internalBuffer == 0){
+ //if (internalBuffer == 0){
+ if (1){
#ifdef DEBUG_FIND_COUNTER
findExpensiveCount++;
if (findCount % 500 == 0)
diff --git a/WebCore/src/kwq/KWQTextStorage.h b/WebCore/src/kwq/KWQTextStorage.h
index 0d8da50..bbb3ae4 100644
--- a/WebCore/src/kwq/KWQTextStorage.h
+++ b/WebCore/src/kwq/KWQTextStorage.h
@@ -45,4 +45,8 @@
- (void)setString: (NSString *)dString;
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (NSDictionary *)fragmentCache;
+#endif
+
@end
diff --git a/WebCore/src/kwq/KWQTextStorage.mm b/WebCore/src/kwq/KWQTextStorage.mm
index 3dffeaf..05ae66d 100644
--- a/WebCore/src/kwq/KWQTextStorage.mm
+++ b/WebCore/src/kwq/KWQTextStorage.mm
@@ -105,6 +105,10 @@
[super dealloc];
}
+#ifdef _DEBUG_LAYOUT_FRAGMENT
+- (NSDictionary *)fragmentCache { return fragmentCache; }
+#endif
+
- (void)addLayoutManager:(id)obj {
_layoutManager = [obj retain];
[obj setTextStorage:self];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list