JavaScriptCore:
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Sep 2008 13:59:06 +0000 (13:59 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Sep 2008 13:59:06 +0000 (13:59 +0000)
2008-09-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave Hyatt.

        Based on initial work by Darin Adler.

        - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
        - use this to JIT inline code for eq_null and neq_null
        https://bugs.webkit.org/show_bug.cgi?id=20823

        0.5% speedup on SunSpider
        ~4% speedup on Richards benchmark

        * VM/CTI.cpp:
        (JSC::CTI::privateCompileMainPass):
        * VM/Machine.cpp:
        (JSC::jsTypeStringForValue):
        (JSC::jsIsObjectType):
        (JSC::Machine::privateExecute):
        (JSC::Machine::cti_op_is_undefined):
        * VM/Machine.h:
        * kjs/JSCell.h:
        * kjs/JSValue.h:
        * kjs/StringObjectThatMasqueradesAsUndefined.h:
        (JSC::StringObjectThatMasqueradesAsUndefined::create):
        (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
        * kjs/StructureID.h:
        (JSC::StructureID::mutableTypeInfo):
        * kjs/TypeInfo.h:
        (JSC::TypeInfo::TypeInfo):
        (JSC::TypeInfo::masqueradesAsUndefined):
        * kjs/operations.cpp:
        (JSC::equal):
        * masm/X86Assembler.h:
        (JSC::X86Assembler::):
        (JSC::X86Assembler::setne_r):
        (JSC::X86Assembler::setnz_r):
        (JSC::X86Assembler::testl_i32m):

WebCore:

2008-09-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dave Hyatt.

        Based on initial work by Darin Adler.

        - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
        - use this to JIT inline code for eq_null and neq_null
        https://bugs.webkit.org/show_bug.cgi?id=20823

        * WebCore.xcodeproj/project.pbxproj:
        * WebCore.vcproj/WebCore.vcproj:
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::nameGetter):
        * bindings/js/JSHTMLAllCollection.cpp: Added.
        (WebCore::):
        * bindings/js/JSHTMLAllCollection.h:
        (WebCore::JSHTMLAllCollection::createStructureID):
        (WebCore::JSHTMLAllCollection::toBoolean):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/VM/CTI.cpp
JavaScriptCore/VM/Machine.cpp
JavaScriptCore/VM/Machine.h
JavaScriptCore/kjs/JSCell.h
JavaScriptCore/kjs/JSValue.h
JavaScriptCore/kjs/StringObjectThatMasqueradesAsUndefined.h
JavaScriptCore/kjs/StructureID.h
JavaScriptCore/kjs/TypeInfo.h
JavaScriptCore/kjs/operations.cpp
JavaScriptCore/masm/X86Assembler.h
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
WebCore/bindings/js/JSHTMLAllCollection.cpp [new file with mode: 0644]
WebCore/bindings/js/JSHTMLAllCollection.h

index 7fac378d1d26108c8164895c0746eaa65d805462..d895f429f642aa1a911434f38471e14a3f5e2a8b 100644 (file)
@@ -1,3 +1,42 @@
+2008-09-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Dave Hyatt.
+        
+        Based on initial work by Darin Adler.
+        
+        - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
+        - use this to JIT inline code for eq_null and neq_null
+        https://bugs.webkit.org/show_bug.cgi?id=20823
+
+        0.5% speedup on SunSpider
+        ~4% speedup on Richards benchmark
+        
+        * VM/CTI.cpp:
+        (JSC::CTI::privateCompileMainPass):
+        * VM/Machine.cpp:
+        (JSC::jsTypeStringForValue):
+        (JSC::jsIsObjectType):
+        (JSC::Machine::privateExecute):
+        (JSC::Machine::cti_op_is_undefined):
+        * VM/Machine.h:
+        * kjs/JSCell.h:
+        * kjs/JSValue.h:
+        * kjs/StringObjectThatMasqueradesAsUndefined.h:
+        (JSC::StringObjectThatMasqueradesAsUndefined::create):
+        (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
+        * kjs/StructureID.h:
+        (JSC::StructureID::mutableTypeInfo):
+        * kjs/TypeInfo.h:
+        (JSC::TypeInfo::TypeInfo):
+        (JSC::TypeInfo::masqueradesAsUndefined):
+        * kjs/operations.cpp:
+        (JSC::equal):
+        * masm/X86Assembler.h:
+        (JSC::X86Assembler::):
+        (JSC::X86Assembler::setne_r):
+        (JSC::X86Assembler::setnz_r):
+        (JSC::X86Assembler::testl_i32m):
+
 2008-09-22  Tor Arne Vestbø  <tavestbo@trolltech.com>
 
         Reviewed by Simon.
index 244bafe66ade29d9a52fcff930284f0ae32a66e3..fc3946b6dcf19e3abecf93557528ac043ebc580e 100644 (file)
@@ -1590,16 +1590,62 @@ void CTI::privateCompileMainPass()
             break;
         }
         case op_eq_null: {
-            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
-            emitCall(i, Machine::cti_op_eq_null);
-            emitPutResult(instruction[i + 1].u.operand);
+            unsigned dst = instruction[i + 1].u.operand;
+            unsigned src1 = instruction[i + 2].u.operand;
+
+            emitGetArg(src1, X86::eax);
+            m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
+            X86Assembler::JmpSrc isImmediate = m_jit.emitUnlinkedJnz();
+
+            m_jit.movl_mr(OBJECT_OFFSET(JSCell, m_structureID), X86::eax, X86::ecx);
+            m_jit.testl_i32m(MasqueradesAsUndefined, OBJECT_OFFSET(StructureID, m_typeInfo.m_flags), X86::ecx);
+            m_jit.setnz_r(X86::eax);
+
+            X86Assembler::JmpSrc wasNotImmediate = m_jit.emitUnlinkedJmp();
+
+            m_jit.link(isImmediate, m_jit.label());
+
+            m_jit.movl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::ecx);
+            m_jit.andl_rr(X86::eax, X86::ecx);
+            m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::ecx);
+            m_jit.sete_r(X86::eax);
+
+            m_jit.link(wasNotImmediate, m_jit.label());
+
+            m_jit.movzbl_rr(X86::eax, X86::eax);
+            emitTagAsBoolImmediate(X86::eax);
+            emitPutResult(dst);
+
             i += 3;
             break;
         }
         case op_neq_null: {
-            emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
-            emitCall(i, Machine::cti_op_neq_null);
-            emitPutResult(instruction[i + 1].u.operand);
+            unsigned dst = instruction[i + 1].u.operand;
+            unsigned src1 = instruction[i + 2].u.operand;
+
+            emitGetArg(src1, X86::eax);
+            m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
+            X86Assembler::JmpSrc isImmediate = m_jit.emitUnlinkedJnz();
+
+            m_jit.movl_mr(OBJECT_OFFSET(JSCell, m_structureID), X86::eax, X86::ecx);
+            m_jit.testl_i32m(MasqueradesAsUndefined, OBJECT_OFFSET(StructureID, m_typeInfo.m_flags), X86::ecx);
+            m_jit.setz_r(X86::eax);
+
+            X86Assembler::JmpSrc wasNotImmediate = m_jit.emitUnlinkedJmp();
+
+            m_jit.link(isImmediate, m_jit.label());
+
+            m_jit.movl_i32r(~JSImmediate::ExtendedTagBitUndefined, X86::ecx);
+            m_jit.andl_rr(X86::eax, X86::ecx);
+            m_jit.cmpl_i32r(JSImmediate::FullTagTypeNull, X86::ecx);
+            m_jit.setne_r(X86::eax);
+
+            m_jit.link(wasNotImmediate, m_jit.label());
+
+            m_jit.movzbl_rr(X86::eax, X86::eax);
+            emitTagAsBoolImmediate(X86::eax);
+            emitPutResult(dst);
+
             i += 3;
             break;
         }
index 6ebd5e8fdb22b4824bff32b3230d77645f72d13c..44d99a696b100653c71019d0c601374650c3577d 100644 (file)
@@ -246,7 +246,7 @@ static JSValue* jsTypeStringForValue(ExecState* exec, JSValue* v)
     if (v->isObject()) {
         // Return "undefined" for objects that should be treated
         // as null when doing comparisons.
-        if (static_cast<JSObject*>(v)->masqueradeAsUndefined())
+        if (static_cast<JSObject*>(v)->structureID()->typeInfo().masqueradesAsUndefined())
             return jsNontrivialString(exec, "undefined");
         CallData callData;
         if (static_cast<JSObject*>(v)->getCallData(callData) != CallTypeNone)
@@ -264,7 +264,7 @@ static bool jsIsObjectType(JSValue* v)
     if (type == NumberType || type == StringType)
         return false;
     if (type == ObjectType) {
-        if (static_cast<JSObject*>(v)->masqueradeAsUndefined())
+        if (static_cast<JSObject*>(v)->structureID()->typeInfo().masqueradesAsUndefined())
             return false;
         CallData callData;
         if (static_cast<JSObject*>(v)->getCallData(callData) != CallTypeNone)
@@ -1565,7 +1565,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, ExecState* exec, RegisterFi
             NEXT_OPCODE;
         }
         
-        r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && static_cast<JSCell*>(src)->masqueradeAsUndefined());
+        r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && src->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
         ++vPC;
         NEXT_OPCODE;
     }
@@ -1605,7 +1605,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, ExecState* exec, RegisterFi
             NEXT_OPCODE;
         }
         
-        r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->masqueradeAsUndefined());
+        r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
         ++vPC;
         NEXT_OPCODE;
     }
@@ -2151,7 +2151,7 @@ JSValue* Machine::privateExecute(ExecutionFlag flag, ExecState* exec, RegisterFi
         int dst = (++vPC)->u.operand;
         int src = (++vPC)->u.operand;
         JSValue* v = r[src].jsValue(exec);
-        r[dst] = jsBoolean(v->isUndefined() || (v->isObject() && static_cast<JSObject*>(v)->masqueradeAsUndefined()));
+        r[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
 
         ++vPC;
         NEXT_OPCODE;
@@ -5264,7 +5264,7 @@ JSValue* Machine::cti_op_typeof(CTI_ARGS)
 JSValue* Machine::cti_op_is_undefined(CTI_ARGS)
 {
     JSValue* v = ARG_src1;
-    return jsBoolean(v->isUndefined() || (v->isObject() && static_cast<JSObject*>(v)->masqueradeAsUndefined()));
+    return jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
 }
 
 JSValue* Machine::cti_op_is_boolean(CTI_ARGS)
@@ -5505,24 +5505,6 @@ void Machine::cti_op_debug(CTI_ARGS)
     exec->machine()->debug(exec, codeBlock, scopeChain, r, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
 }
 
-JSValue* Machine::cti_op_eq_null(CTI_ARGS)
-{
-    JSValue* src = ARG_src1;
-    if (src->isUndefinedOrNull())
-        return jsBoolean(true);
-
-    return jsBoolean(!JSImmediate::isImmediate(src) && static_cast<JSCell*>(src)->masqueradeAsUndefined());
-}
-
-JSValue* Machine::cti_op_neq_null(CTI_ARGS)
-{
-    JSValue* src = ARG_src1;
-    if (src->isUndefinedOrNull())
-        return jsBoolean(false);
-
-    return jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->masqueradeAsUndefined());
-}
-
 void* Machine::cti_vm_throw(CTI_ARGS)
 {
     ExecState* exec = ARG_exec;
index 07d32eac8cf1b6cbb16ba932fa70d93e47b8ee96..3cf1813727135bd1eeb26aa121f5f27d8b827bd1 100644 (file)
@@ -220,8 +220,6 @@ namespace JSC {
         static void SFX_CALL cti_op_put_setter(CTI_ARGS);
         static JSValue* SFX_CALL cti_op_new_error(CTI_ARGS);
         static void SFX_CALL cti_op_debug(CTI_ARGS);
-        static JSValue* SFX_CALL cti_op_eq_null(CTI_ARGS);
-        static JSValue* SFX_CALL cti_op_neq_null(CTI_ARGS);
 
         static void* SFX_CALL cti_vm_throw(CTI_ARGS);
         static void* SFX_CALL cti_vm_compile(CTI_ARGS);
index 8853559e775704edd25601d098ec319a0fbc22fb..de2c6d3b002b9d48c8f31a692d385bf3d20062b4 100644 (file)
@@ -77,9 +77,6 @@ namespace JSC {
         virtual UString toString(ExecState*) const = 0;
         virtual JSObject* toObject(ExecState*) const = 0;
 
-        // WebCore uses this to make document.all and style.filter undetectable
-        virtual bool masqueradeAsUndefined() const { return false; }
-
         // Garbage collection.
         void* operator new(size_t, ExecState*);
         void* operator new(size_t, void* placementNewDestination) { return placementNewDestination; }
index e232e9991a7bdca817a4b02781cc515d29adedf5..d901c0b8d23958949a2bd75f2344fd6d16d854a4 100644 (file)
@@ -56,8 +56,6 @@ namespace JSC {
      */
     class JSValue : Noncopyable {
         friend class JSCell; // so it can derive from this class
-        friend class Heap; // so it can call asCell()
-        friend class Machine; // so it can call asCell()
     private:
         JSValue();
         virtual ~JSValue();
@@ -145,15 +143,14 @@ namespace JSC {
 
         JSValue* getJSNumber(); // 0 if this is not a JSNumber or number object
 
+        JSCell* asCell();
+        const JSCell* asCell() const;
+
     private:
         bool getPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
         bool getPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
         int32_t toInt32SlowCase(ExecState*, bool& ok) const;
         uint32_t toUInt32SlowCase(ExecState*, bool& ok) const;
-
-        // Implementation details.
-        JSCell* asCell();
-        const JSCell* asCell() const;
     };
 
     inline JSValue::JSValue()
index 59172cd0b81e1326cba8978add14f766a26dc7b6..d703228112eb817ad8866909518e3d5656f7837b 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef StringObjectThatMasqueradesAsUndefined_h
 #define StringObjectThatMasqueradesAsUndefined_h
 
+#include "JSGlobalObject.h"
 #include "StringObject.h"
 #include "ustring.h"
 
@@ -29,12 +30,23 @@ namespace JSC {
     // WebCore uses this to make style.filter undetectable
     class StringObjectThatMasqueradesAsUndefined : public StringObject {
     public:
+        static StringObjectThatMasqueradesAsUndefined* create(ExecState* exec, const UString& string)
+        {
+            return new (exec) StringObjectThatMasqueradesAsUndefined(exec,
+                createStructureID(exec->lexicalGlobalObject()->stringPrototype()), string);
+        }
+
+    private:
         StringObjectThatMasqueradesAsUndefined(ExecState* exec, PassRefPtr<StructureID> structure, const UString& string)
             : StringObject(exec, structure, string)
         {
         }
 
-        virtual bool masqueradeAsUndefined() const { return true; }
+        static PassRefPtr<StructureID> createStructureID(JSValue* proto) 
+        { 
+            return StructureID::create(proto, TypeInfo(ObjectType, MasqueradesAsUndefined)); 
+        }
+
         virtual bool toBoolean(ExecState*) const { return false; }
     };
  
index d176ef37b30b5b60b4b41eca72992c020bccd4be..426290b6f835037e1e73ab892f71fa77acbde1c5 100644 (file)
@@ -100,6 +100,9 @@ namespace JSC {
 
         const TypeInfo& typeInfo() const { return m_typeInfo; }
 
+        // For use when first creating a new structure.
+        TypeInfo& mutableTypeInfo() { return m_typeInfo; }
+
         JSValue* storedPrototype() const { return m_prototype; }
         JSValue* prototypeForLookup(ExecState*); 
 
index 0f2cc1436349931eb0ab4f1f11bcb681be18ec3f..b4d33d472860747614d3946d32d66cd22c8402b7 100644 (file)
 
 namespace JSC {
 
+    // WebCore uses this to make document.all and style.filter undetectable.
+    static const unsigned MasqueradesAsUndefined = 0x1;
+
     class TypeInfo {
         friend class CTI;
     public:
-        TypeInfo(JSType type) : m_type(type) { }
-        
+        TypeInfo(JSType type, unsigned flags = 0) : m_type(type), m_flags(flags) { }
+
         JSType type() const { return m_type; }
 
+        bool masqueradesAsUndefined() const { return m_flags & MasqueradesAsUndefined; }
+
     private:
         JSType m_type;
+        unsigned m_flags;
     };
 
 }
index 4d51e757bff5d4b2bff46535f4b045d6620a28b1..12271df757151f8fcf367e9a740ba77cc706545c 100644 (file)
@@ -53,15 +53,15 @@ startOver:
     if (v1->isUndefinedOrNull()) {
         if (v2->isUndefinedOrNull())
             return true;
-        if (!v2->isObject())
+        if (JSImmediate::isImmediate(v2))
             return false;
-        return static_cast<JSObject*>(v2)->masqueradeAsUndefined();
+        return v2->asCell()->structureID()->typeInfo().masqueradesAsUndefined();
     }
 
     if (v2->isUndefinedOrNull()) {
-        if (!v1->isObject())
+        if (JSImmediate::isImmediate(v1))
             return false;
-        return static_cast<JSObject*>(v1)->masqueradeAsUndefined();
+        return v1->asCell()->structureID()->typeInfo().masqueradesAsUndefined();
     }
 
     if (v1->isObject()) {
index c5fa6e69bb2d28bbe6ecfc9b033a0f5c87fd7a35..b0df2fc3d4797b071f0f2253205a1a17f9adfc3e 100644 (file)
@@ -192,6 +192,7 @@ public:
         OP_GROUP1A_Ev                   = 0x8F,
         OP_CDQ                          = 0x99,
         OP_SETE                         = 0x94,
+        OP_SETNE                        = 0x95,
         OP_GROUP2_EvIb                  = 0xC1,
         OP_RET                          = 0xC3,
         OP_GROUP11_EvIz                 = 0xC7,
@@ -400,6 +401,18 @@ public:
         sete_r(dst);
     }
 
+    void setne_r(RegisterID dst)
+    {
+        m_buffer->putByte(OP_2BYTE_ESCAPE);
+        m_buffer->putByte(OP_SETNE);
+        m_buffer->putByte(MODRM(3, 0, dst));
+    }
+
+    void setnz_r(RegisterID dst)
+    {
+        setne_r(dst);
+    }
+
     void orl_rr(RegisterID src, RegisterID dst)
     {
         m_buffer->putByte(OP_OR_EvGv);
@@ -454,6 +467,20 @@ public:
         m_buffer->putIntUnchecked(imm);
     }
 
+    void testl_i32m(int imm, RegisterID dst)
+    {
+        m_buffer->putByte(OP_GROUP3_EvIz);
+        emitModRm_opm(GROUP3_OP_TEST, dst);
+        m_buffer->putInt(imm);
+    }
+
+    void testl_i32m(int imm, int offset, RegisterID dst)
+    {
+        m_buffer->putByte(OP_GROUP3_EvIz);
+        emitModRm_opm(GROUP3_OP_TEST, dst, offset);
+        m_buffer->putInt(imm);
+    }
+
     void testl_rr(RegisterID src, RegisterID dst)
     {
         m_buffer->putByte(OP_TEST_EvGv);
index 17235a824e8eb1e5ca564432f93bfa45e771da17..5b40ad51530a7eaf594ed497111278e66758ae1c 100644 (file)
@@ -1,3 +1,23 @@
+2008-09-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Based on initial work by Darin Adler.
+        
+        - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
+        - use this to JIT inline code for eq_null and neq_null
+        https://bugs.webkit.org/show_bug.cgi?id=20823
+        
+        * WebCore.xcodeproj/project.pbxproj:
+        * WebCore.vcproj/WebCore.vcproj:
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::nameGetter):
+        * bindings/js/JSHTMLAllCollection.cpp: Added.
+        (WebCore::):
+        * bindings/js/JSHTMLAllCollection.h:
+        (WebCore::JSHTMLAllCollection::createStructureID):
+        (WebCore::JSHTMLAllCollection::toBoolean):
+
 2008-09-22  Tor Arne Vestbø  <tavestbo@trolltech.com>
 
         Reviewed by Simon.
index 50d24d8b1f2dc426b84e43a79b47d5421481e0c7..45963edfaf3a908b929411f32e61b5365074e7ac 100644 (file)
@@ -638,6 +638,7 @@ webcore_sources += \
        WebCore/bindings/js/JSEventTargetBase.cpp \
        WebCore/bindings/js/JSEventTargetBase.h \
        WebCore/bindings/js/JSEventTargetNode.cpp \
+       WebCore/bindings/js/JSHTMLAllCollection.cpp \
        WebCore/bindings/js/JSEventTargetNode.h \
        WebCore/bindings/js/JSHTMLAllCollection.h \
        WebCore/bindings/js/JSHTMLAppletElementCustom.cpp \
index b41d926146e9f12d9b713708c1a3de98c7f34e28..e0af5b42e180a98c3574bbafa514c63905ab854d 100644 (file)
@@ -379,6 +379,7 @@ SOURCES += \
     bindings/js/JSEventCustom.cpp \
     bindings/js/JSEventTargetBase.cpp \
     bindings/js/JSEventTargetNode.cpp \
+    bindings/js/JSHTMLAllCollection.cpp \
     bindings/js/JSHistoryCustom.cpp \
     bindings/js/JSJavaScriptCallFrameCustom.cpp \
     bindings/js/JSHTMLAppletElementCustom.cpp \
index 56c1cae7016d2fc69566fa51799db99b8cc815f2..7496dd03e04f334303e16f447547f587f4372a08 100644 (file)
                                        RelativePath="..\bindings\js\JSHTMLAllCollection.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\JSHTMLAllCollection.cpp"\r
+                                       >\r
                                <File\r
                                        RelativePath="..\bindings\js\JSHTMLAppletElementCustom.cpp"\r
                                        >\r
index 42fb7118d3b1dcfbf5e3a2e04176d2acaedd4536..e86bbb64e92340dcc603d6360a69bcb640a12f1b 100644 (file)
                934F71420D5A6F4400018D69 /* ResourceError.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71410D5A6F4400018D69 /* ResourceError.h */; settings = {ATTRIBUTES = (Private, ); }; };
                934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
                934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; };
+               9350E70D0E87500B00189FFF /* JSHTMLAllCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9350E70C0E87500B00189FFF /* JSHTMLAllCollection.cpp */; };
                9352071909BD3BA500F2038D /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 9352071709BD3BA500F2038D /* StaticConstructors.h */; };
                935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; };
                935207C009BD412100F2038D /* LocalizedStringsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935207BF09BD412000F2038D /* LocalizedStringsMac.mm */; };
                934F71410D5A6F4400018D69 /* ResourceError.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceError.h; sourceTree = "<group>"; };
                934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallenge.h; sourceTree = "<group>"; };
                934FE9E40B5CA539003E4A73 /* FileChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileChooser.cpp; sourceTree = "<group>"; };
+               9350E70C0E87500B00189FFF /* JSHTMLAllCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAllCollection.cpp; sourceTree = "<group>"; };
                9352071709BD3BA500F2038D /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
                935207BD09BD410A00F2038D /* LocalizedStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedStrings.h; sourceTree = "<group>"; };
                935207BF09BD412000F2038D /* LocalizedStringsMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalizedStringsMac.mm; sourceTree = "<group>"; };
                                BCD9C26A0C17AA81005C90A2 /* JSEventTargetNode.cpp */,
                                BCD9C26B0C17AA81005C90A2 /* JSEventTargetNode.h */,
                                BC6DC7A00C1A4BFA004E2017 /* JSHTMLAllCollection.h */,
+                               9350E70C0E87500B00189FFF /* JSHTMLAllCollection.cpp */,
                                A80E7E640A1A82EC007FB8C5 /* JSHTMLInputElementBase.cpp */,
                                A80E7E630A1A82EC007FB8C5 /* JSHTMLInputElementBase.h */,
                                A826E8AD0A1A8F2300CD1BB6 /* JSHTMLOptionElementConstructor.cpp */,
                                B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */,
                                BCEF869F0E844E9D00A85CD5 /* ScrollbarThemeMac.mm in Sources */,
                                089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
+                               9350E70D0E87500B00189FFF /* JSHTMLAllCollection.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 1a53e995e9dffaf6ac00b50ba7f6d98f036f772d..8c36951290a7fb4fe0f4e2b82f76677649ae57f4 100644 (file)
@@ -60,6 +60,7 @@ This file contains the list of files needed to build WebCore.
         bindings/js/JSEventCustom.cpp
         bindings/js/JSEventTargetBase.cpp
         bindings/js/JSEventTargetNode.cpp
+        bindings/js/JSHTMLAllCollection.cpp
         bindings/js/JSHistoryCustom.cpp
         bindings/js/JSHTMLAppletElementCustom.cpp
         bindings/js/JSHTMLCollectionCustom.cpp
index f3c37cb55f76f9976159f5699ed2c451bf7963b6..7176c3dc10bc8c859a88500217448963d993d1a9 100644 (file)
@@ -150,9 +150,7 @@ JSValue* JSCSSStyleDeclaration::nameGetter(ExecState* exec, const Identifier& pr
 
     // Make the SVG 'filter' attribute undetectable, to avoid confusion with the IE 'filter' attribute.
     if (propertyName == "filter")
-        return new (exec) StringObjectThatMasqueradesAsUndefined(exec,
-            StringObjectThatMasqueradesAsUndefined::createStructureID(exec->lexicalGlobalObject()->stringPrototype()),
-            thisObj->impl()->getPropertyValue(prop));
+        return StringObjectThatMasqueradesAsUndefined::create(exec, thisObj->impl()->getPropertyValue(prop));
 
     return jsString(exec, thisObj->impl()->getPropertyValue(prop));
 }
diff --git a/WebCore/bindings/js/JSHTMLAllCollection.cpp b/WebCore/bindings/js/JSHTMLAllCollection.cpp
new file mode 100644 (file)
index 0000000..ce2609c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSHTMLAllCollection.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+const ClassInfo JSHTMLAllCollection::s_info = { "HTMLAllCollection", 0, 0, 0 };
+
+} // namespace WebCore
index 8357a92636b9731b0aef3c45e43e1293c7501dd5..f85c997fc65f76ebdc4a1a1308e68444cd17e82d 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef JSHTMLAllCollection_h
 #define JSHTMLAllCollection_h
 
+#include "HTMLCollection.h"
 #include "JSHTMLCollection.h"
 
 namespace WebCore {
@@ -39,8 +40,15 @@ namespace WebCore {
         {
         }
 
+        static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValue* proto) 
+        { 
+            return JSC::StructureID::create(proto, JSC::TypeInfo(JSC::ObjectType, JSC::MasqueradesAsUndefined)); 
+        }
+
+        static const JSC::ClassInfo s_info;
+
+    private:
         virtual bool toBoolean(JSC::ExecState*) const { return false; }
-        virtual bool masqueradeAsUndefined() const { return true; }
     };
 
 } // namespace WebCore