Optimize JSCSSStyleDeclaration after performance regression in r21854.
- Check static table before name getter in JSCSSStyleDeclaration::getOwnPropertySlot()
- Get rid of a string allocation by keeping string as KJS::Identifier for canGetItemsForName()
functions.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::canGetItemsForName):
* bindings/js/JSHTMLAppletElementCustom.cpp:
(WebCore::JSHTMLAppletElement::canGetItemsForName):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::canGetItemsForName):
* bindings/js/JSHTMLEmbedElementCustom.cpp:
(WebCore::JSHTMLEmbedElement::canGetItemsForName):
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::canGetItemsForName):
* bindings/js/JSHTMLFrameSetElementCustom.cpp:
(WebCore::JSHTMLFrameSetElement::canGetItemsForName):
* bindings/js/JSHTMLObjectElementCustom.cpp:
(WebCore::JSHTMLObjectElement::canGetItemsForName):
* bindings/scripts/CodeGeneratorJS.pm:
* css/CSSStyleDeclaration.idl:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21979
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-06-05 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Geoff.
+
+ Optimize JSCSSStyleDeclaration after performance regression in r21854.
+
+ - Check static table before name getter in JSCSSStyleDeclaration::getOwnPropertySlot()
+ - Get rid of a string allocation by keeping string as KJS::Identifier for canGetItemsForName()
+ functions.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::JSCSSStyleDeclaration::canGetItemsForName):
+ * bindings/js/JSHTMLAppletElementCustom.cpp:
+ (WebCore::JSHTMLAppletElement::canGetItemsForName):
+ * bindings/js/JSHTMLDocumentCustom.cpp:
+ (WebCore::JSHTMLDocument::canGetItemsForName):
+ * bindings/js/JSHTMLEmbedElementCustom.cpp:
+ (WebCore::JSHTMLEmbedElement::canGetItemsForName):
+ * bindings/js/JSHTMLFormElementCustom.cpp:
+ (WebCore::JSHTMLFormElement::canGetItemsForName):
+ * bindings/js/JSHTMLFrameSetElementCustom.cpp:
+ (WebCore::JSHTMLFrameSetElement::canGetItemsForName):
+ * bindings/js/JSHTMLObjectElementCustom.cpp:
+ (WebCore::JSHTMLObjectElement::canGetItemsForName):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * css/CSSStyleDeclaration.idl:
+
2007-06-04 Sam Weinig <sam@webkit.org>
Reviewed, tweaked and landed by Anders.
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
return CSSStyleDeclaration::isPropertyName(cssPropertyName(propertyName));
}
-bool JSCSSStyleDeclaration::canGetItemsForName(ExecState*, CSSStyleDeclaration*, const AtomicString& propertyName)
+bool JSCSSStyleDeclaration::canGetItemsForName(ExecState*, CSSStyleDeclaration*, const Identifier& propertyName)
{
- return isCSSPropertyName(propertyName.domString());
+ return isCSSPropertyName(propertyName);
}
JSValue* JSCSSStyleDeclaration::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
return runtimeObjectCallAsFunction(exec, thisObj, args, static_cast<HTMLElement*>(impl()));
}
-bool JSHTMLAppletElement::canGetItemsForName(ExecState*, HTMLAppletElement*, const AtomicString& propertyName)
+bool JSHTMLAppletElement::canGetItemsForName(ExecState*, HTMLAppletElement*, const Identifier& propertyName)
{
return propertyName == "__apple_runtime_object";
}
using namespace KJS;
using namespace HTMLNames;
-bool JSHTMLDocument::canGetItemsForName(ExecState*, HTMLDocument* doc, const AtomicString& propertyName)
+bool JSHTMLDocument::canGetItemsForName(ExecState*, HTMLDocument* doc, const Identifier& propertyName)
{
return doc->hasNamedItem(propertyName) || doc->hasDocExtraNamedItem(propertyName);
}
return runtimeObjectCallAsFunction(exec, thisObj, args, static_cast<HTMLElement*>(impl()));
}
-bool JSHTMLEmbedElement::canGetItemsForName(ExecState*, HTMLEmbedElement*, const AtomicString& propertyName)
+bool JSHTMLEmbedElement::canGetItemsForName(ExecState*, HTMLEmbedElement*, const Identifier& propertyName)
{
return propertyName == "__apple_runtime_object";
}
namespace WebCore {
-bool JSHTMLFormElement::canGetItemsForName(ExecState* exec, HTMLFormElement* form, const AtomicString& propertyName)
+bool JSHTMLFormElement::canGetItemsForName(ExecState* exec, HTMLFormElement* form, const Identifier& propertyName)
{
Vector<RefPtr<Node> > namedItems;
form->getNamedElements(propertyName, namedItems);
using namespace KJS;
using namespace HTMLNames;
-bool JSHTMLFrameSetElement::canGetItemsForName(ExecState*, HTMLFrameSetElement* frameSet, const AtomicString& propertyName)
+bool JSHTMLFrameSetElement::canGetItemsForName(ExecState*, HTMLFrameSetElement* frameSet, const Identifier& propertyName)
{
Node* frame = frameSet->children()->namedItem(propertyName);
return frame && frame->hasTagName(frameTag);
return runtimeObjectCallAsFunction(exec, thisObj, args, static_cast<HTMLElement*>(impl()));
}
-bool JSHTMLObjectElement::canGetItemsForName(ExecState*, HTMLObjectElement*, const AtomicString& propertyName)
+bool JSHTMLObjectElement::canGetItemsForName(ExecState*, HTMLObjectElement*, const Identifier& propertyName)
{
return propertyName == "__apple_runtime_object";
}
if ($dataNode->extendedAttributes->{"HasNameGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
push(@headerContent, "private:\n");
push(@headerContent, " static KJS::JSValue* nameGetter(KJS::ExecState*, KJS::JSObject*, const KJS::Identifier&, const KJS::PropertySlot&);\n");
- push(@headerContent, " static bool canGetItemsForName(KJS::ExecState*, $implClassName*, const AtomicString&);\n")
+ push(@headerContent, " static bool canGetItemsForName(KJS::ExecState*, $implClassName*, const KJS::Identifier&);\n")
}
push(@headerContent, "};\n\n");
module css {
// Introduced in DOM Level 2:
- interface [GenerateConstructor, CustomPutFunction, HasOverridingNameGetter, HasIndexGetter] CSSStyleDeclaration {
+ interface [GenerateConstructor, CustomPutFunction, HasNameGetter, HasIndexGetter] CSSStyleDeclaration {
attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString cssText
setter raises(DOMException);