Skip to content
  • darin's avatar
    JavaScriptCore: · 107c53d2
    darin authored
            Reviewed by Maciej.
    
            * JavaScriptCore.pbproj/project.pbxproj: Make dtoa.h visible as an SPI so I can
    	use it inside QString.
    
    WebFoundation:
    
            Reviewed by Maciej.
    
            * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.
    
    WebCore:
    
            Reviewed by Maciej and Dave.
    
    	- optimizations that improve speed; total is 13.8% on cached cvs-base on my machine
    
            * khtml/css/css_valueimpl.h: Add isKonqBody() and genericFamilyType() to find out if
    	a font is a standard one. This is much faster than doing string comparisons all the time.
            * khtml/css/css_valueimpl.cpp: (FontFamilyValueImpl::FontFamilyValueImpl):
    	Check the font names against the standard ones on time when the FontFamilyValueImpl
    	object is constructed rather than every time the stuff is matched.
            * khtml/css/cssparser.h: Add pseudoType() and extractPseudoType() to CSSSelector so we
    	don't have to do string compares all the time.
            * khtml/css/cssparser.cpp:
            (StyleBaseImpl::parseValue): Use QConstString in a way that's effective (with an
    	object that has a long enough lifetime), or don't use it at all.
            (StyleBaseImpl::parseContent): Ditto.
            (StyleBaseImpl::preprocess): Preprocess into a buffer, usually on the stack, rather than
    	using QString += QChar over and over again.
            (CSSSelector::extractPseudoType): Convert the value string into a type, and get rid of it.
    	Saves memory because the string goes away. And doing it once is much faster than string
    	comparing each time.
            * khtml/css/cssstyleselector.cpp:
    	(cleanPath): Restructure to save one find() in the common case.
    	(checkPseudoState): Restructure to avoid some DOMString creation/destruction in the case
    	where the tag is not an <A>. Also use QConstString correctly.
    	(CSSStyleSelector::checkOneSelector): Use the new pseudoType() instead of string compares.
    	(CSSStyleSelector::applyRule): Use isKonqBody() and genericFamilyType() instead of string
    	comparisons.
    
            * khtml/dom/dom_string.h: Make the destructor non-virtual. This was a big win, and a mistake
    	the way it was before. Also make the DOMString constructor with no parameters inline.
            * khtml/dom/dom_string.cpp:
            (DOMString::string): Don't use QConstString here, since it does no good.
            (DOM::operator==): Rewrite to do things faster and avoid calling strlen.
    
            * khtml/html/html_objectimpl.h: Don't use QConstString in places where it does harm and no good.
            * khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::parseAttribute): Use QConstString properly.
    
            * khtml/html/htmltokenizer.cpp:
            (tagMatch): Added.
            (HTMLTokenizer::parseSpecial): Change tokenizing so it doesn't construct temporary strings (with
    	QConstString) just to compare small substrings.
    
            * khtml/khtml_part.cpp: (KHTMLPart::write): Don't use a decoder object when source is all ASCII.
    
            * kwq/KWQColor.mm:
            (hex2int): Don't bother with uppercase hex since we always lowercase anyway.
            (QColor::setNamedColor): Use a new gperf-based table instead of an NSDictionary to look up colors.
            * kwq/KWQColorData.c: Added this autogenerated file.
            * kwq/KWQColorData.gperf: Added. Source file with list of colors and color values.
            * kwq/Makefile.am: Build KWQColorData.c from KWQColorData.gperf.
            * WebCore.pbproj/project.pbxproj: Added KWQColorData.gperf.
    
            * khtml/misc/helper.cpp: (khtml::setNamedColor): Don't call setNamedColor again with the lowercased
    	color name, since our QColor::setNamedColor already has to lowercase the name (because it has to check
    	all names before checking any hex values).
    
            * khtml/rendering/font.h: Don't initialize the QFontMetrics since in every case we end up changing
    	the font later anyway. Also remove unused field.
            * khtml/rendering/font.cpp: (Font::update): Use the new QFontMetrics::setFont for speed.
    
            * khtml/rendering/render_object.cpp: (RenderObject::enclosingLayer): Change it so it doesn't get
    	the layer twice. This function showed up on the sample so we know it's hot.
    
            * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::containsOnlyWhitespace): Did a faster implementation
    	that doesn't call QChar::direction() except for non-ASCII characters.
    
            * kwq/KWQFontMetrics.h: Add empty constructor for use in font.cpp. Add accessor and setter for the
    	font too. Made baselineOffset() inline since it's trivial.
            * kwq/KWQFontMetrics.mm:
    	(QFontMetricsPrivate::QFontMetricsPrivate): Don't make the renderer until we use it.
    	(QFontMetricsPrivate::getRenderer): Make it here.
    	(QFontMetricsPrivate::font): Added.
    	(QFontMetricsPrivate::setFont): Added. Dumps the renderer if the font is different.
            (QFontMetrics::QFontMetrics): Added empty constructor.
            (QFontMetrics::setFont): Added.
    
            * kwq/KWQKURL.mm: (KURL::parse): Avoid function call overhead calling strncasecmp and strncmp.
    	Also made the check for localhost case insensitive.
    
            * kwq/KWQString.h: Remove _isUnicodeInternal and _isAsciiInternal, since they are trivially
    	computed, and it saves time to not have that extra field to manipulate. Removed private
    	data() function since it's the same as *dataHandle and not really more clear. Made ascii()
    	and unicode() simpler and inline. Also made latin1() and getCFString() inline. Renamed
    	QStringData to KWQStringData.
            * kwq/KWQString.mm:
            (QStringData::QStringData): Remove initializers for the xxxInternal.
            (QStringData::initialize): Removed some unnecessary if statements, and made a slight improvement
    	in the case of a 0-length string that comes with a pointer for Unicode (can't do it in the
            char * case because it's a feature that's used).
            (QString::makeSharedNull): No need to set _isUnicodeInternal.
            (QStringData::~QStringData): Use the new functions instead of the old bits.
            (QStringData::increaseAsciiSize): Grow faster when we get to larger sizes where the "good size"
    	call doesn't have as much of an effect. Simplified by removing unneeded code.
            (QStringData::increaseUnicodeSize): Ditto.
            (QStringData::makeAscii): Update for removal of _isAsciiInternal.
            (QStringData::makeUnicode): Update for removal of _isUnicodeInternal.
            (QString::detachIfInternal): Add this new inline to speed things up for the common case where
    	there's no detaching needed.
            (QString::at): Simplify, there were excess if branches here.
            (QString::toDouble): Use kjs_strtod and don't copy the string using QCString for additional speed.
            (QString::lower): Don't detach if the string is already all lowercase. Added a FIXME about the
    	code that assumes all "ASCII" bytes are truly ASCII. This code blurs the distinction between Latin-1
    	and ASCII in a way that will not work right for Latin-1 characters in an 8-byte character QString.
            (QString::detachInternal): Update for removal of _isUnicodeInternal.
            (QString::detach): Removed a special case for shared_null that was dead code since shared_null has
    	the _isUnicodeValid flag set.
            (operator==): Rewrote the comparison with char * to avoid the costly call to strlen.
    
            * Makefile.am: Updated the rules here so the force clean timestamp works right.
            * force-clean-timestamp: Touched this since the header dependencies don't seem right
    	for the DOMString constructor change, at least.
    	* WebCore-tests.exp: Exported a symbol now needed by tests since QString does more inlining.
    	* WebCore-combined.exp: Re-generated.
    
    WebBrowser:
    
            Reviewed by Maciej.
    
            * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    107c53d2