Reviewed by Geoff.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2007 20:33:54 +0000 (20:33 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2007 20:33:54 +0000 (20:33 +0000)
        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

WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
WebCore/bindings/js/JSHTMLDocumentCustom.cpp
WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
WebCore/bindings/js/JSHTMLFormElementCustom.cpp
WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/css/CSSStyleDeclaration.idl

index e1f0e273237e941748c6f235ccdbce68e8b12e12..e83f72d9c49d55312c13a2b2bea2f95e6f06cb02 100644 (file)
@@ -1,3 +1,31 @@
+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.
index 7d36f4763dce8393d18557e193b70d799b5fa30d..22a4808ece84a11c3299683997c8c8835d42824a 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
index 710f3b4dd366bb277685740bdba27f2552ebe59a..0bc894d27686d8db2f7b9f34ee97e33c2870b4c6 100644 (file)
@@ -75,9 +75,9 @@ static bool isCSSPropertyName(const Identifier& propertyName)
     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)
index 347e7f82190831f881c887f17fb87b4f05f70a3a..fc21b800f0c1020980cbe2f465ae19b745e6b5e2 100644 (file)
@@ -54,7 +54,7 @@ JSValue* JSHTMLAppletElement::callAsFunction(ExecState* exec, JSObject* thisObj,
     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";
 }
index aa818ac447e3777976aac8cd439c1861a2320f2c..9db557fa0a625dcdd18f22209edfaf5ec509fd32 100644 (file)
@@ -42,7 +42,7 @@ namespace WebCore {
 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);
 }
index f260a5cf0c74a7c3bc544757caa097949bdde677..2652a822edd99b5bdea46a6ee32dd6e8f0957ec7 100644 (file)
@@ -54,7 +54,7 @@ JSValue* JSHTMLEmbedElement::callAsFunction(ExecState* exec, JSObject* thisObj,
     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";
 }
index 2c44e03304b7a5355fef65333fa199fbd41155a4..d7e1908dce9080d19eae9a1556609d7c705ae8c2 100644 (file)
@@ -33,7 +33,7 @@ using namespace KJS;
 
 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);
index c287d46c47ea1144f2bd31e99936665a80e53a8b..ac00d486f5aa652474b4bb2388dcac4ccc5e426c 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
 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);
index 8dd7f5251f0da0b4a46111e71471cf74ec0f17de..7976138668adb828c127f2214df0717dd772e38e 100644 (file)
@@ -54,7 +54,7 @@ JSValue* JSHTMLObjectElement::callAsFunction(ExecState* exec, JSObject* thisObj,
     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";
 }
index 91db67c219d392e65464e4e8a55c2a21d62626d6..062405ca1154683c8b60b6806f6f474e0fc6e025 100644 (file)
@@ -477,7 +477,7 @@ sub GenerateHeader
     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");
index f066a360c278e950cbfd1091676d271ea7a6bae2..103daa6ffe0c34331011855c852d73379927bff5 100644 (file)
@@ -21,7 +21,7 @@
 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);