Changeset 37799 in webkit


Ignore:
Timestamp:
Oct 22, 2008, 5:11:11 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-10-22 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

A bit over 3% faster on V8 tests.

  • JavascriptCore.exp: Export leak-related functions..
  • API/JSCallbackConstructor.h: (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot since this class doesn't override getPropertySlot.
  • API/JSCallbackFunction.h: (JSC::JSCallbackFunction::createStructureID): Ditto.
  • VM/ExceptionHelpers.cpp: (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure that's created just for this class instead of trying to share a single "null prototype" structure.
  • VM/Machine.cpp: (JSC::Machine::cti_op_create_arguments_no_params): Rename Arguments::ArgumentsNoParameters to Arguments::NoParameters.


  • kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters to Arguments::NoParameters. (JSC::Arguments::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot. (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
  • kjs/DatePrototype.h: (JSC::DatePrototype::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • kjs/FunctionPrototype.h: (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot since this class doesn't override getPropertySlot.
  • kjs/InternalFunction.h: (JSC::InternalFunction::createStructureID): Ditto.
  • kjs/JSArray.h: (JSC::JSArray::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual version that uses the structure bit to decide whether to call the virtual version.
  • kjs/JSFunction.h: (JSC::JSFunction::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • kjs/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed nullProtoStructureID.
  • kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
  • kjs/JSGlobalObject.h: (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • kjs/JSNotAnObject.h: (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure that's created just for this class instead of trying to share a single "null prototype" structure. (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function virtual for clarity and made it private since no one should call it if they already have a pointer to this specific type. (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just for this class instead of trying to share a single "null prototype" structure. (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • kjs/JSObject.h: (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot. (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code between getOwnPropertySlot and fastGetOwnPropertySlot. (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the functions that call them. Moved the guts of this function into inlineGetOwnPropertySlot. (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the HasStandardGetOwnPropertySlot bit and if it's set, calls inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot. (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot. (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
  • kjs/JSWrapperObject.h: Made constructor protected to emphasize that this class is only a base class and never instantiated.
  • kjs/MathObject.h: (JSC::MathObject::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • kjs/NumberConstructor.h: (JSC::NumberConstructor::createStructureID): Ditto.
  • kjs/RegExpConstructor.h: (JSC::RegExpConstructor::createStructureID): Ditto.
  • kjs/RegExpObject.h: (JSC::RegExpObject::createStructureID): Ditto.
  • kjs/StringObject.h: (JSC::StringObject::createStructureID): Ditto.
  • kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and hasStandardGetOwnPropertySlot accessor function.

JavaScriptGlue:

2008-10-22 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

  • JSRun.cpp: (JSGlueGlobalObject::JSGlueGlobalObject): Moved constructor here. Set up flags in its new location in global object data, and set up a structure for UserObjectImp too. (JSRun::JSRun): Added code to give the JSGlueGlobalObject its own unique structure, rather than using the default one from JSGlobalObject.
  • JSRun.h: Made JSGlueGlobalObject take a structure ID. Also moved the data into a separate data object. And added userObjectStructure, a Structure to be used by UserObjectImp.
  • JSUtils.cpp: Removed unused sharedGlobalData global. (JSObjectKJSValue): Pass Structure in when creating UserObjectImp. (unprotectGlobalObject): Use JSGlueGLobalObject type specifically. (initializeGlobalObjectKey): Removed code to set up unused sharedGlobalData. (getThreadGlobalObject): Added. Shared by JSObjectKJSValue and getThreadGlobalExecState. Also now passes in a structure ID when creating the global object. (getThreadGlobalExecState): Changed to call getThreadGlobalObject.
  • UserObjectImp.cpp: (UserObjectImp::UserObjectImp): Changed to take a structure.
  • UserObjectImp.h: (UserObjectImp::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.

WebCore:

2008-10-22 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

  • bindings/js/JSDOMWindowShell.h: (WebCore::JSDOMWindowShell::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • bindings/js/JSInspectorCallbackWrapper.cpp: (WebCore::JSInspectorCallbackWrapper::wrap): Change to use a unique structure for this class rather than sharing nullProtoStructureID, which no longer exists.
  • bindings/js/JSNamedNodesCollection.h: (WebCore::JSNamedNodesCollection::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • bindings/js/JSRGBColor.h: (WebCore::JSRGBColor::createStructureID): Ditto.
  • bindings/scripts/CodeGeneratorJS.pm: Added createStructureID functions for the wrappers, constructors, and prototypes in any case where they override getOwnPropertySlot, without HasStandardGetOwnPropertySlot.
  • bridge/objc/objc_runtime.h: (JSC::Bindings::ObjcFallbackObjectImp::createStructureID): Added. Returns a structure without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  • bridge/qt/qt_runtime.h: (JSC::Bindings::QtRuntimeMethod::createStructureID): Ditto.
  • bridge/runtime_array.h: (JSC::RuntimeArray::createStructureID): Ditto.
  • bridge/runtime_method.h: (JSC::RuntimeMethod::createStructureID): Ditto.
  • bridge/runtime_object.h: (JSC::RuntimeObjectImp::createStructureID): Ditto.
Location:
trunk
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSCallbackConstructor.h

    r37684 r37799  
    4242    static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
    4343    {
    44         return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));
     44        return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot));
    4545    }
    4646
  • trunk/JavaScriptCore/API/JSCallbackFunction.h

    r37684 r37799  
    4242    static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
    4343    {
    44         return StructureID::create(proto, TypeInfo(ObjectType));
     44        return StructureID::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot));
    4545    }
    4646
  • trunk/JavaScriptCore/ChangeLog

    r37789 r37799  
     12008-10-22  Darin Adler  <[email protected]>
     2
     3        Reviewed by Sam Weinig.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=21294
     6          Bug 21294: Devirtualize getOwnPropertySlot()
     7
     8        A bit over 3% faster on V8 tests.
     9
     10        * JavascriptCore.exp: Export leak-related functions..
     11
     12        * API/JSCallbackConstructor.h:
     13        (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot
     14        since this class doesn't override getPropertySlot.
     15        * API/JSCallbackFunction.h:
     16        (JSC::JSCallbackFunction::createStructureID): Ditto.
     17
     18        * VM/ExceptionHelpers.cpp:
     19        (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure
     20        that's created just for this class instead of trying to share a single "null
     21        prototype" structure.
     22
     23        * VM/Machine.cpp:
     24        (JSC::Machine::cti_op_create_arguments_no_params): Rename
     25        Arguments::ArgumentsNoParameters to Arguments::NoParameters.
     26       
     27        * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to
     28        Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters
     29        to Arguments::NoParameters.
     30        (JSC::Arguments::createStructureID): Added. Returns a structure without
     31        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     32        (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
     33
     34        * kjs/DatePrototype.h:
     35        (JSC::DatePrototype::createStructureID): Added. Returns a structure without
     36        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     37
     38        * kjs/FunctionPrototype.h:
     39        (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot
     40        since this class doesn't override getPropertySlot.
     41        * kjs/InternalFunction.h:
     42        (JSC::InternalFunction::createStructureID): Ditto.
     43
     44        * kjs/JSArray.h:
     45        (JSC::JSArray::createStructureID): Added. Returns a structure without
     46        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     47
     48        * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual
     49        version that uses the structure bit to decide whether to call the virtual
     50        version.
     51
     52        * kjs/JSFunction.h:
     53        (JSC::JSFunction::createStructureID): Added. Returns a structure without
     54        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     55
     56        * kjs/JSGlobalData.cpp:
     57        (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed
     58        nullProtoStructureID.
     59        * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
     60
     61        * kjs/JSGlobalObject.h:
     62        (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without
     63        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     64
     65        * kjs/JSNotAnObject.h:
     66        (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure
     67        that's created just for this class instead of trying to share a single "null
     68        prototype" structure.
     69        (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function
     70        virtual for clarity and made it private since no one should call it if they
     71        already have a pointer to this specific type.
     72        (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just
     73        for this class instead of trying to share a single "null prototype" structure.
     74        (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without
     75        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     76
     77        * kjs/JSObject.h:
     78        (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot.
     79        (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code
     80        between getOwnPropertySlot and fastGetOwnPropertySlot.
     81        (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the
     82        functions that call them. Moved the guts of this function into
     83        inlineGetOwnPropertySlot.
     84        (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the
     85        HasStandardGetOwnPropertySlot bit and if it's set, calls
     86        inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot.
     87        (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot.
     88        (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
     89
     90        * kjs/JSWrapperObject.h: Made constructor protected to emphasize that
     91        this class is only a base class and never instantiated.
     92
     93        * kjs/MathObject.h:
     94        (JSC::MathObject::createStructureID): Added. Returns a structure without
     95        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     96        * kjs/NumberConstructor.h:
     97        (JSC::NumberConstructor::createStructureID): Ditto.
     98        * kjs/RegExpConstructor.h:
     99        (JSC::RegExpConstructor::createStructureID): Ditto.
     100        * kjs/RegExpObject.h:
     101        (JSC::RegExpObject::createStructureID): Ditto.
     102        * kjs/StringObject.h:
     103        (JSC::StringObject::createStructureID): Ditto.
     104
     105        * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and
     106        hasStandardGetOwnPropertySlot accessor function.
     107
    11082008-10-22  Cameron Zwarich  <[email protected]>
    2109
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r37712 r37799  
    113113__ZN3JSC11PropertyMap3putERKNS_10IdentifierEj
    114114__ZN3JSC11PropertyMapD1Ev
     115__ZN3JSC11StructureID17stopIgnoringLeaksEv
     116__ZN3JSC11StructureID18startIgnoringLeaksEv
    115117__ZN3JSC11StructureID21addPropertyTransitionEPS0_RKNS_10IdentifierEjRm
    116118__ZN3JSC11StructureID21clearEnumerationCacheEv
  • trunk/JavaScriptCore/VM/ExceptionHelpers.cpp

    r37684 r37799  
    5252public:
    5353    InterruptedExecutionError(JSGlobalData* globalData)
    54         : JSObject(globalData->nullProtoStructureID)
     54        : JSObject(globalData->interruptedExecutionErrorStructure)
    5555    {
    5656    }
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37789 r37799  
    48264826    CTI_STACK_HACK();
    48274827
    4828     Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame, Arguments::ArgumentsNoParameters);
     4828    Arguments* arguments = new (ARG_globalData) Arguments(ARG_callFrame, Arguments::NoParameters);
    48294829    ARG_callFrame->setCalleeArguments(arguments);
    48304830    ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
  • trunk/JavaScriptCore/kjs/Arguments.h

    r37684 r37799  
    5454    class Arguments : public JSObject {
    5555    public:
    56         enum ArgumentsParameters {
    57             ArgumentsNoParameters
    58         };
     56        enum NoParametersType { NoParameters };
    5957
    6058        Arguments(CallFrame*);
    61         Arguments(CallFrame*, enum ArgumentsParameters);
     59        Arguments(CallFrame*, NoParametersType);
    6260        virtual ~Arguments();
    6361
     
    7472            d->activation = activation;
    7573            d->registers = &activation->registerAt(0);
     74        }
     75
     76        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     77        {
     78            return StructureID::create(prototype, TypeInfo(ObjectType));
    7679        }
    7780
     
    154157    }
    155158
    156     inline Arguments::Arguments(CallFrame* callFrame, enum ArgumentsParameters)
     159    inline Arguments::Arguments(CallFrame* callFrame, NoParametersType)
    157160        : JSObject(callFrame->lexicalGlobalObject()->argumentsStructure())
    158161        , d(new ArgumentsData)
    159162    {
     163        ASSERT(!callFrame->callee()->m_body->parameterCount());
     164
    160165        unsigned numArguments = callFrame->argumentCount() - 1;
    161166
  • trunk/JavaScriptCore/kjs/DatePrototype.h

    r36726 r37799  
    3636        virtual const ClassInfo* classInfo() const { return &info; }
    3737        static const ClassInfo info;
     38
     39        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     40        {
     41            return StructureID::create(prototype, TypeInfo(ObjectType));
     42        }
    3843    };
    3944
  • trunk/JavaScriptCore/kjs/FunctionPrototype.h

    r37747 r37799  
    3333        static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
    3434        {
    35             return StructureID::create(proto, TypeInfo(ObjectType));
     35            return StructureID::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot));
    3636        }
    3737
  • trunk/JavaScriptCore/kjs/InternalFunction.h

    r37747 r37799  
    4141        static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
    4242        {
    43             return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));
     43            return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot));
    4444        }
    4545
  • trunk/JavaScriptCore/kjs/JSArray.h

    r37684 r37799  
    7777        void fillArgList(ExecState*, ArgList&);
    7878
     79        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     80        {
     81            return StructureID::create(prototype, TypeInfo(ObjectType));
     82        }
     83
    7984    protected:
    8085        virtual void put(ExecState*, const Identifier& propertyName, JSValuePtr, PutPropertySlot&);
  • trunk/JavaScriptCore/kjs/JSCell.h

    r37714 r37799  
    100100
    101101    private:
    102         // Base implementation, but for non-object classes implements getPropertySlot.
     102        // Base implementation; for non-object classes implements getPropertySlot.
     103        bool fastGetOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
    103104        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
    104105        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
  • trunk/JavaScriptCore/kjs/JSFunction.h

    r37684 r37799  
    6969        RefPtr<FunctionBodyNode> m_body;
    7070
     71        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     72        {
     73            return StructureID::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance));
     74        }
     75
    7176    private:
    7277        virtual const ClassInfo* classInfo() const { return &info; }
  • trunk/JavaScriptCore/kjs/JSGlobalData.cpp

    r37705 r37799  
    3535#include "JSClassRef.h"
    3636#include "JSLock.h"
     37#include "JSNotAnObject.h"
    3738#include "JSStaticScopeObject.h"
    3839#include "Machine.h"
     
    6970    , regExpConstructorTable(new HashTable(JSC::regExpConstructorTable))
    7071    , stringTable(new HashTable(JSC::stringTable))
    71     , nullProtoStructureID(JSObject::createStructureID(jsNull()))
    7272    , activationStructureID(JSActivation::createStructureID(jsNull()))
     73    , interruptedExecutionErrorStructure(JSObject::createStructureID(jsNull()))
    7374    , staticScopeStructureID(JSStaticScopeObject::createStructureID(jsNull()))
    7475    , stringStructureID(JSString::createStructureID(jsNull()))
     76    , notAnObjectErrorStubStructure(JSNotAnObjectErrorStub::createStructureID(jsNull()))
     77    , notAnObjectStructure(JSNotAnObject::createStructureID(jsNull()))
    7578    , numberStructureID(JSNumberCell::createStructureID(jsNull()))
    7679    , identifierTable(createIdentifierTable())
  • trunk/JavaScriptCore/kjs/JSGlobalData.h

    r37684 r37799  
    7979        const HashTable* stringTable;
    8080       
    81         RefPtr<StructureID> nullProtoStructureID;
    8281        RefPtr<StructureID> activationStructureID;
     82        RefPtr<StructureID> interruptedExecutionErrorStructure;
    8383        RefPtr<StructureID> staticScopeStructureID;
    8484        RefPtr<StructureID> stringStructureID;
     85        RefPtr<StructureID> notAnObjectErrorStubStructure;
     86        RefPtr<StructureID> notAnObjectStructure;
    8587        RefPtr<StructureID> numberStructureID;
    8688
  • trunk/JavaScriptCore/kjs/JSGlobalObject.h

    r37759 r37799  
    252252        JSGlobalObjectData* d() const { return static_cast<JSGlobalObjectData*>(JSVariableObject::d); }
    253253
     254        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     255        {
     256            return StructureID::create(prototype, TypeInfo(ObjectType));
     257        }
     258
    254259    protected:
    255260        struct GlobalPropertyInfo {
  • trunk/JavaScriptCore/kjs/JSNotAnObject.h

    r37684 r37799  
    3737    public:
    3838        JSNotAnObjectErrorStub(ExecState* exec, bool isNull)
    39             : JSObject(exec->globalData().nullProtoStructureID)
     39            : JSObject(exec->globalData().notAnObjectErrorStubStructure)
    4040            , m_isNull(isNull)
    4141        {
    4242        }
     43
    4344        bool isNull() const { return m_isNull; }
    44         bool isNotAnObjectErrorStub() const { return true; }
     45
    4546    private:
     47        virtual bool isNotAnObjectErrorStub() const { return true; }
     48
    4649        bool m_isNull;
    4750    };
     
    5356    public:
    5457        JSNotAnObject(ExecState* exec, JSNotAnObjectErrorStub* exception)
    55             : JSObject(exec->globalData().nullProtoStructureID)
     58            : JSObject(exec->globalData().notAnObjectStructure)
    5659            , m_exception(exception)
    5760        {
     61        }
     62
     63        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     64        {
     65            return StructureID::create(prototype, TypeInfo(ObjectType));
    5866        }
    5967
  • trunk/JavaScriptCore/kjs/JSObject.h

    r37747 r37799  
    5656        friend class BatchedTransitionOptimizer;
    5757        friend class CTI;
     58        friend class JSCell;
    5859
    5960    public:
     
    184185        static const size_t nonInlineBaseStorageCapacity = 16;
    185186
    186         static PassRefPtr<StructureID> createStructureID(JSValuePtr proto) { return StructureID::create(proto, TypeInfo(ObjectType)); }
     187        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     188        {
     189            return StructureID::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot));
     190        }
    187191
    188192    protected:
     
    190194
    191195    private:
     196        bool inlineGetOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     197
    192198        const HashEntry* findPropertyHashEntry(ExecState*, const Identifier& propertyName) const;
    193199        StructureID* createInheritorID();
     
    267273}
    268274
    269 inline JSValuePtr JSObject::get(ExecState* exec, const Identifier& propertyName) const
    270 {
    271     PropertySlot slot(this);
    272     if (const_cast<JSObject*>(this)->getPropertySlot(exec, propertyName, slot))
    273         return slot.getValue(exec, propertyName);
    274    
    275     return jsUndefined();
    276 }
    277 
    278 inline JSValuePtr JSObject::get(ExecState* exec, unsigned propertyName) const
    279 {
    280     PropertySlot slot(this);
    281     if (const_cast<JSObject*>(this)->getPropertySlot(exec, propertyName, slot))
    282         return slot.getValue(exec, propertyName);
    283 
    284     return jsUndefined();
    285 }
    286 
    287 // It may seem crazy to inline a function this large but it makes a big difference
    288 // since this is function very hot in variable lookup
    289 inline bool JSObject::getPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    290 {
    291     JSObject* object = this;
    292     while (true) {
    293         if (object->getOwnPropertySlot(exec, propertyName, slot))
    294             return true;
    295 
    296         JSValuePtr prototype = object->prototype();
    297         if (!prototype->isObject())
    298             return false;
    299 
    300         object = asObject(prototype);
    301     }
    302 }
    303 
    304 inline bool JSObject::getPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    305 {
    306     JSObject* object = this;
    307 
    308     while (true) {
    309         if (object->getOwnPropertySlot(exec, propertyName, slot))
    310             return true;
    311 
    312         JSValuePtr prototype = object->prototype();
    313         if (!prototype->isObject())
    314             break;
    315 
    316         object = asObject(prototype);
     275ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     276{
     277    if (JSValuePtr* location = getDirectLocation(propertyName)) {
     278        if (m_structureID->hasGetterSetterProperties() && location[0]->isGetterSetter())
     279            fillGetterPropertySlot(slot, location);
     280        else
     281            slot.setValueSlot(this, location, offsetForLocation(location));
     282        return true;
     283    }
     284
     285    // non-standard Netscape extension
     286    if (propertyName == exec->propertyNames().underscoreProto) {
     287        slot.setValue(prototype());
     288        return true;
    317289    }
    318290
     
    320292}
    321293
    322 // It may seem crazy to inline a function this large, especially a virtual function,
    323 // but it makes a big difference to property lookup that derived classes can inline their
    324 // base class call to this.
    325294ALWAYS_INLINE bool JSObject::getOwnPropertySlotForWrite(ExecState* exec, const Identifier& propertyName, PropertySlot& slot, bool& slotIsWriteable)
    326295{
     
    352321ALWAYS_INLINE bool JSObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    353322{
    354     if (JSValuePtr* location = getDirectLocation(propertyName)) {
    355         if (m_structureID->hasGetterSetterProperties() && location[0]->isGetterSetter())
    356             fillGetterPropertySlot(slot, location);
    357         else
    358             slot.setValueSlot(this, location, offsetForLocation(location));
    359         return true;
    360     }
    361 
    362     // non-standard Netscape extension
    363     if (propertyName == exec->propertyNames().underscoreProto) {
    364         slot.setValue(prototype());
    365         return true;
    366     }
    367 
    368     return false;
     323    return inlineGetOwnPropertySlot(exec, propertyName, slot);
     324}
     325
     326ALWAYS_INLINE bool JSCell::fastGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     327{
     328    if (structureID()->typeInfo().hasStandardGetOwnPropertySlot())
     329        return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot);
     330    return getOwnPropertySlot(exec, propertyName, slot);
     331}
     332
     333// It may seem crazy to inline a function this large but it makes a big difference
     334// since this is function very hot in variable lookup
     335inline bool JSObject::getPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     336{
     337    JSObject* object = this;
     338    while (true) {
     339        if (object->fastGetOwnPropertySlot(exec, propertyName, slot))
     340            return true;
     341        JSValuePtr prototype = object->prototype();
     342        if (!prototype->isObject())
     343            return false;
     344        object = asObject(prototype);
     345    }
     346}
     347
     348inline bool JSObject::getPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
     349{
     350    JSObject* object = this;
     351    while (true) {
     352        if (object->getOwnPropertySlot(exec, propertyName, slot))
     353            return true;
     354        JSValuePtr prototype = object->prototype();
     355        if (!prototype->isObject())
     356            return false;
     357        object = asObject(prototype);
     358    }
     359}
     360
     361inline JSValuePtr JSObject::get(ExecState* exec, const Identifier& propertyName) const
     362{
     363    PropertySlot slot(this);
     364    if (const_cast<JSObject*>(this)->getPropertySlot(exec, propertyName, slot))
     365        return slot.getValue(exec, propertyName);
     366   
     367    return jsUndefined();
     368}
     369
     370inline JSValuePtr JSObject::get(ExecState* exec, unsigned propertyName) const
     371{
     372    PropertySlot slot(this);
     373    if (const_cast<JSObject*>(this)->getPropertySlot(exec, propertyName, slot))
     374        return slot.getValue(exec, propertyName);
     375
     376    return jsUndefined();
    369377}
    370378
     
    462470    JSCell* cell = asCell();
    463471    while (true) {
    464         if (cell->getOwnPropertySlot(exec, propertyName, slot))
     472        if (cell->fastGetOwnPropertySlot(exec, propertyName, slot))
    465473            return slot.getValue(exec, propertyName);
    466474        ASSERT(cell->isObject());
  • trunk/JavaScriptCore/kjs/JSWrapperObject.h

    r37705 r37799  
    3030    // Number, Boolean and Date which are wrappers for primitive types.
    3131    class JSWrapperObject : public JSObject {
     32    protected:
     33        explicit JSWrapperObject(PassRefPtr<StructureID>);
     34
    3235    public:
    33         explicit JSWrapperObject(PassRefPtr<StructureID>);
    34        
    3536        JSValuePtr internalValue() const { return m_internalValue; }
    3637        void setInternalValue(JSValuePtr);
  • trunk/JavaScriptCore/kjs/MathObject.h

    r36726 r37799  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten ([email protected])
     3 *  Copyright (C) 2008 Apple Inc. All rights reserved.
    34 *
    45 *  This library is free software; you can redistribute it and/or
     
    3334        virtual const ClassInfo* classInfo() const { return &info; }
    3435        static const ClassInfo info;
     36
     37        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     38        {
     39            return StructureID::create(prototype, TypeInfo(ObjectType));
     40        }
    3541    };
    3642
  • trunk/JavaScriptCore/kjs/NumberConstructor.h

    r37684 r37799  
    3232        NumberConstructor(ExecState*, PassRefPtr<StructureID>, NumberPrototype*);
    3333
    34         bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     34        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    3535        JSValuePtr getValueProperty(ExecState*, int token) const;
    3636
    3737        static const ClassInfo info;
     38
     39        static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
     40        {
     41            return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));
     42        }
    3843
    3944        enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
  • trunk/JavaScriptCore/kjs/RegExpConstructor.h

    r37684 r37799  
    3434    public:
    3535        RegExpConstructor(ExecState*, PassRefPtr<StructureID>, RegExpPrototype*);
     36
     37        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     38        {
     39            return StructureID::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance));
     40        }
    3641
    3742        virtual void put(ExecState*, const Identifier& propertyName, JSValuePtr, PutPropertySlot&);
  • trunk/JavaScriptCore/kjs/RegExpObject.h

    r37684 r37799  
    4747        static const ClassInfo info;
    4848
     49        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     50        {
     51            return StructureID::create(prototype, TypeInfo(ObjectType));
     52        }
     53
    4954    private:
    5055        bool match(ExecState*, const ArgList&);
  • trunk/JavaScriptCore/kjs/StringObject.h

    r37684 r37799  
    4646        JSString* internalValue() const { return asString(JSWrapperObject::internalValue());}
    4747
     48        static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     49        {
     50            return StructureID::create(prototype, TypeInfo(ObjectType));
     51        }
     52
    4853    protected:
    4954        StringObject(PassRefPtr<StructureID>, JSString*);
  • trunk/JavaScriptCore/kjs/TypeInfo.h

    r37285 r37799  
    3232namespace JSC {
    3333
    34     // WebCore uses this to make document.all and style.filter undetectable.
     34    // WebCore uses MasqueradesAsUndefined to make document.all and style.filter undetectable.
    3535    static const unsigned MasqueradesAsUndefined = 1;
    3636    static const unsigned ImplementsHasInstance = 1 << 1;
    3737    static const unsigned OverridesHasInstance = 1 << 2;
    3838    static const unsigned NeedsThisConversion = 1 << 3;
     39    static const unsigned HasStandardGetOwnPropertySlot = 1 << 4;
    3940
    4041    class TypeInfo {
     
    4950        bool overridesHasInstance() const { return m_flags & OverridesHasInstance; }
    5051        bool needsThisConversion() const { return m_flags & NeedsThisConversion; }
     52        bool hasStandardGetOwnPropertySlot() const { return m_flags & HasStandardGetOwnPropertySlot; }
    5153
    5254        unsigned flags() const { return m_flags; }
     55
    5356    private:
    5457        JSType m_type;
  • trunk/JavaScriptGlue/ChangeLog

    r37759 r37799  
     12008-10-22  Darin Adler  <[email protected]>
     2
     3        Reviewed by Sam Weinig.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=21294
     6          Bug 21294: Devirtualize getOwnPropertySlot()
     7
     8        * JSRun.cpp:
     9        (JSGlueGlobalObject::JSGlueGlobalObject): Moved constructor here.
     10        Set up flags in its new location in global object data, and set up
     11        a structure for UserObjectImp too.
     12        (JSRun::JSRun): Added code to give the JSGlueGlobalObject its own unique
     13        structure, rather than using the default one from JSGlobalObject.
     14
     15        * JSRun.h: Made JSGlueGlobalObject take a structure ID. Also moved
     16        the data into a separate data object. And added userObjectStructure,
     17        a Structure to be used by UserObjectImp.
     18
     19        * JSUtils.cpp: Removed unused sharedGlobalData global.
     20        (JSObjectKJSValue): Pass Structure in when creating UserObjectImp.
     21        (unprotectGlobalObject): Use JSGlueGLobalObject type specifically.
     22        (initializeGlobalObjectKey): Removed code to set up unused sharedGlobalData.
     23        (getThreadGlobalObject): Added. Shared by JSObjectKJSValue and
     24        getThreadGlobalExecState. Also now passes in a structure ID when creating
     25        the global object.
     26        (getThreadGlobalExecState): Changed to call getThreadGlobalObject.
     27
     28        * UserObjectImp.cpp:
     29        (UserObjectImp::UserObjectImp): Changed to take a structure.
     30        * UserObjectImp.h:
     31        (UserObjectImp::createStructureID): Added. Returns a structure without
     32        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     33
    1342008-10-20  Sam Weinig  <[email protected]>
    235
  • trunk/JavaScriptGlue/JSRun.cpp

    r37759 r37799  
    11/*
    2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#include "JSRun.h"
    3131
     32#include "UserObjectImp.h"
     33#include <JavaScriptCore/SourceRange.h>
    3234#include <JavaScriptCore/completion.h>
    33 #include <JavaScriptCore/SourceRange.h>
     35
     36JSGlueGlobalObject::JSGlueGlobalObject(PassRefPtr<StructureID> structure, JSFlags flags)
     37    : JSGlobalObject(structure, new Data, this)
     38{
     39    d()->flags = flags;
     40    d()->userObjectStructure = UserObjectImp::createStructureID(jsNull());
     41}
    3442
    3543JSRun::JSRun(CFStringRef source, JSFlags inFlags)
    3644    :   JSBase(kJSRunTypeID),
    3745        fSource(CFStringToUString(source)),
    38         fGlobalObject(new (&getThreadGlobalExecState()->globalData()) JSGlueGlobalObject(inFlags)),
     46        fGlobalObject(new (&getThreadGlobalExecState()->globalData()) JSGlueGlobalObject(JSGlueGlobalObject::createStructureID(jsNull()), inFlags)),
    3947        fFlags(inFlags)
    4048{
  • trunk/JavaScriptGlue/JSRun.h

    r37759 r37799  
    3535class JSGlueGlobalObject : public JSGlobalObject {
    3636    public:
    37         JSGlueGlobalObject(JSFlags flags = kJSFlagNone)
    38             : JSGlobalObject()
    39             , fJSFlags(flags)
    40         {
    41         }
     37        JSGlueGlobalObject(PassRefPtr<StructureID>, JSFlags = kJSFlagNone);
    4238
    43         JSFlags Flags() const { return fJSFlags; }
     39        JSFlags Flags() const { return d()->flags; }
     40        StructureID* userObjectStructure() const { return d()->userObjectStructure.get(); }
    4441
    4542    private:
    46         JSFlags fJSFlags;
     43        struct Data : JSGlobalObjectData {
     44            RefPtr<StructureID> userObjectStructure;
     45            JSFlags flags;
     46        };
     47
     48        Data* d() const { return static_cast<Data*>(JSGlobalObject::d()); }
    4749};
    4850
  • trunk/JavaScriptGlue/JSUtils.cpp

    r37759 r37799  
    11/*
    2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4545
    4646static CFTypeRef KJSValueToCFTypeInternal(JSValuePtr inValue, ExecState *exec, ObjectImpList* inImps);
    47 
     47static JSGlueGlobalObject* getThreadGlobalObject();
    4848
    4949//--------------------------------------------------------------------------
     
    184184        {
    185185            ExecState* exec = getThreadGlobalExecState();
    186             result = new (exec) UserObjectImp(exec, ptr);
     186            result = new (exec) UserObjectImp(getThreadGlobalObject()->userObjectStructure(), ptr);
    187187        }
    188188    }
     
    392392static pthread_key_t globalObjectKey;
    393393static pthread_once_t globalObjectKeyOnce = PTHREAD_ONCE_INIT;
    394 JSGlobalData* sharedGlobalData;
    395394
    396395static void unprotectGlobalObject(void* data)
    397396{
    398397    JSLock lock(true);
    399     gcUnprotect(static_cast<JSGlobalObject*>(data));
     398    gcUnprotect(static_cast<JSGlueGlobalObject*>(data));
    400399}
    401400
    402401static void initializeGlobalObjectKey()
    403402{
    404     sharedGlobalData = JSGlobalData::create().releaseRef();
    405403    pthread_key_create(&globalObjectKey, unprotectGlobalObject);
    406404}
    407405
    408 ExecState* getThreadGlobalExecState()
     406static JSGlueGlobalObject* getThreadGlobalObject()
    409407{
    410408    pthread_once(&globalObjectKeyOnce, initializeGlobalObjectKey);
    411     JSGlobalObject* globalObject = static_cast<JSGlobalObject*>(pthread_getspecific(globalObjectKey));
     409    JSGlueGlobalObject* globalObject = static_cast<JSGlueGlobalObject*>(pthread_getspecific(globalObjectKey));
    412410    if (!globalObject) {
    413411        RefPtr<JSGlobalData> globalData = JSGlobalData::create();
    414         globalObject = new (globalData.get()) JSGlueGlobalObject;
     412        globalObject = new (globalData.get()) JSGlueGlobalObject(JSGlueGlobalObject::createStructureID(jsNull()));
    415413        gcProtect(globalObject);
    416414        pthread_setspecific(globalObjectKey, globalObject);
    417415    }
    418    
    419     ExecState* exec = globalObject->globalExec();
     416    return globalObject;
     417}
     418
     419ExecState* getThreadGlobalExecState()
     420{
     421    ExecState* exec = getThreadGlobalObject()->globalExec();
    420422
    421423    // Discard exceptions -- otherwise an exception would forestall JS
     
    424426    return exec;
    425427}
    426 
  • trunk/JavaScriptGlue/UserObjectImp.cpp

    r37705 r37799  
    11/*
    2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535const ClassInfo UserObjectImp::info = { "UserObject", 0, 0, 0 };
    3636
    37 UserObjectImp::UserObjectImp(ExecState* exec, JSUserObject* userObject)
    38     : JSObject(exec->globalData().nullProtoStructureID)
     37UserObjectImp::UserObjectImp(PassRefPtr<StructureID> structure, JSUserObject* userObject)
     38    : JSObject(structure)
    3939    , fJSUserObject((JSUserObject*)userObject->Retain())
    4040{
  • trunk/JavaScriptGlue/UserObjectImp.h

    r37705 r37799  
    11/*
    2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535#include <JavaScriptCore/JSType.h>
    3636
    37 class UserObjectImp : public JSObject
    38 {
     37class UserObjectImp : public JSObject {
    3938public:
    40     UserObjectImp(ExecState* exec, JSUserObject* userObject);
     39    UserObjectImp(PassRefPtr<StructureID>, JSUserObject*);
    4140    virtual ~UserObjectImp();
    4241
     
    6160    JSUserObject *GetJSUserObject() const;
    6261
     62    static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     63    {
     64        return StructureID::create(prototype, TypeInfo(ObjectType));
     65    }
     66
    6367private:
    6468    static JSValuePtr userObjectGetter(ExecState*, const Identifier& propertyName, const PropertySlot&);
  • trunk/WebCore/ChangeLog

    r37798 r37799  
     12008-10-22  Darin Adler  <[email protected]>
     2
     3        Reviewed by Sam Weinig.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=21294
     6          Bug 21294: Devirtualize getOwnPropertySlot()
     7
     8        * bindings/js/JSDOMWindowShell.h:
     9        (WebCore::JSDOMWindowShell::createStructureID): Added. Returns a structure without
     10        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     11
     12        * bindings/js/JSInspectorCallbackWrapper.cpp:
     13        (WebCore::JSInspectorCallbackWrapper::wrap): Change to use a unique structure
     14        for this class rather than sharing nullProtoStructureID, which no longer exists.
     15
     16        * bindings/js/JSNamedNodesCollection.h:
     17        (WebCore::JSNamedNodesCollection::createStructureID): Added. Returns a structure without
     18        HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     19        * bindings/js/JSRGBColor.h:
     20        (WebCore::JSRGBColor::createStructureID): Ditto.
     21
     22        * bindings/scripts/CodeGeneratorJS.pm: Added createStructureID functions for the wrappers,
     23        constructors, and prototypes in any case where they override getOwnPropertySlot, without
     24        HasStandardGetOwnPropertySlot.
     25
     26        * bridge/objc/objc_runtime.h:
     27        (JSC::Bindings::ObjcFallbackObjectImp::createStructureID): Added. Returns a structure
     28        without HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
     29        * bridge/qt/qt_runtime.h:
     30        (JSC::Bindings::QtRuntimeMethod::createStructureID): Ditto.
     31        * bridge/runtime_array.h:
     32        (JSC::RuntimeArray::createStructureID): Ditto.
     33        * bridge/runtime_method.h:
     34        (JSC::RuntimeMethod::createStructureID): Ditto.
     35        * bridge/runtime_object.h:
     36        (JSC::RuntimeObjectImp::createStructureID): Ditto.
     37
    1382008-10-22  Brent Fulgham  <[email protected]>
    239
  • trunk/WebCore/bindings/js/JSDOMWindowShell.h

    r37684 r37799  
    6161        void* operator new(size_t);
    6262
     63        static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr prototype)
     64        {
     65            return JSC::StructureID::create(prototype, JSC::TypeInfo(JSC::ObjectType));
     66        }
     67
    6368    private:
    6469        virtual void mark();
  • trunk/WebCore/bindings/js/JSInspectorCallbackWrapper.cpp

    r37705 r37799  
    4545const ClassInfo JSInspectorCallbackWrapper::s_info = { "JSInspectorCallbackWrapper", &JSQuarantinedObjectWrapper::s_info, 0, 0 };
    4646
     47static StructureID* leakInspectorCallbackWrapperStructure()
     48{
     49    StructureID::startIgnoringLeaks();
     50    StructureID* structure = JSInspectorCallbackWrapper::createStructureID(jsNull()).releaseRef();
     51    StructureID::stopIgnoringLeaks();
     52    return structure;
     53}
     54
    4755JSValuePtr JSInspectorCallbackWrapper::wrap(ExecState* unwrappedExec, JSValuePtr unwrappedValue)
    4856{
     
    6169    ASSERT(prototype->isNull() || prototype->isObject());
    6270
    63     if (prototype->isNull())
    64         return new (unwrappedExec) JSInspectorCallbackWrapper(unwrappedExec, unwrappedObject, unwrappedExec->globalData().nullProtoStructureID);
     71    if (prototype->isNull()) {
     72        static StructureID* structure = leakInspectorCallbackWrapperStructure();
     73        return new (unwrappedExec) JSInspectorCallbackWrapper(unwrappedExec, unwrappedObject, structure);
     74    }
    6575    return new (unwrappedExec) JSInspectorCallbackWrapper(unwrappedExec, unwrappedObject, asObject(wrap(unwrappedExec, prototype))->inheritorID());
    6676}
  • trunk/WebCore/bindings/js/JSNamedNodesCollection.h

    r37684 r37799  
    5050        }
    5151
     52        static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr prototype)
     53        {
     54            return JSC::StructureID::create(prototype, JSC::TypeInfo(JSC::ObjectType));
     55        }
     56
    5257    private:
    5358        static JSC::JSValuePtr lengthGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
  • trunk/WebCore/bindings/js/JSRGBColor.h

    r37684 r37799  
    4444        }
    4545
     46        static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr prototype)
     47        {
     48            return JSC::StructureID::create(prototype, JSC::TypeInfo(JSC::ObjectType));
     49        }
     50
    4651    private:
    4752        unsigned m_color;
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r37784 r37799  
    483483    # Structure ID
    484484    if ($interfaceName eq "DOMWindow") {
    485         push(@headerContent, "    static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr proto)\n" .
    486              "    {\n" .
    487              "        return JSC::StructureID::create(proto, JSC::TypeInfo(JSC::ObjectType, JSC::ImplementsHasInstance | JSC::NeedsThisConversion));\n" .
    488              "    }\n\n");
    489     }
     485        push(@headerContent,
     486            "    static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr prototype)\n" .
     487            "    {\n" .
     488            "        return JSC::StructureID::create(prototype, JSC::TypeInfo(JSC::ObjectType, JSC::ImplementsHasInstance | JSC::NeedsThisConversion));\n" .
     489            "    }\n\n");
     490    } elsif ($hasGetter) {
     491        push(@headerContent,
     492            "    static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr prototype)\n" .
     493            "    {\n" .
     494            "        return JSC::StructureID::create(prototype, JSC::TypeInfo(JSC::ObjectType));\n" .
     495            "    }\n\n");
     496    }
     497
    490498    # Custom mark function
    491499    push(@headerContent, "    virtual void mark();\n\n") if $dataNode->extendedAttributes->{"CustomMarkFunction"};
     
    661669    if ($numFunctions > 0 || $numConstants > 0) {
    662670        push(@headerContent, "    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n");
     671        push(@headerContent,
     672            "    static PassRefPtr<JSC::StructureID> createStructureID(JSC::JSValuePtr prototype)\n" .
     673            "    {\n" .
     674            "        return JSC::StructureID::create(prototype, JSC::TypeInfo(JSC::ObjectType));\n" .
     675            "    }\n");
    663676    }
    664677    push(@headerContent, "    ${className}Prototype(PassRefPtr<JSC::StructureID> structure) : JSC::JSObject(structure) { }\n");
     
    675688
    676689    if ($numAttributes > 0 || $dataNode->extendedAttributes->{"GenerateConstructor"}) {
    677         push(@headerContent,"// Attibutes\n\n");
     690        push(@headerContent,"// Attributes\n\n");
    678691        foreach my $attribute (@{$dataNode->attributes}) {
    679692            my $getter = "js" . $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($attribute->signature->type =~ /Constructor$/ ? "Constructor" : "");
  • trunk/WebCore/bridge/objc/objc_runtime.h

    r37705 r37799  
    105105    }
    106106
     107    static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     108    {
     109        return StructureID::create(prototype, TypeInfo(ObjectType));
     110    }
     111
    107112private:
    108113    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
  • trunk/WebCore/bridge/qt/qt_runtime.h

    r37706 r37799  
    139139
    140140// Common base class (doesn't really do anything interesting)
    141 class QtRuntimeMethod : public InternalFunction
    142 {
     141class QtRuntimeMethod : public InternalFunction {
    143142public:
    144143    virtual ~QtRuntimeMethod();
     
    149148    {
    150149        return exec->lexicalGlobalObject()->functionPrototype();
     150    }
     151
     152    static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     153    {
     154        return StructureID::create(proto, TypeInfo(ObjectType));
    151155    }
    152156
  • trunk/WebCore/bridge/runtime_array.h

    r37705 r37799  
    5757    }
    5858
     59    static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     60    {
     61        return StructureID::create(prototype, TypeInfo(ObjectType));
     62    }
     63
    5964private:
    6065    static JSValuePtr lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
  • trunk/WebCore/bridge/runtime_method.h

    r37684 r37799  
    4646    }
    4747
     48    static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     49    {
     50        return StructureID::create(prototype, TypeInfo(ObjectType, ImplementsHasInstance));
     51    }
     52
    4853private:
    4954    static JSValuePtr lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
  • trunk/WebCore/bridge/runtime_object.h

    r37684 r37799  
    5555    }
    5656
     57    static PassRefPtr<StructureID> createStructureID(JSValuePtr prototype)
     58    {
     59        return StructureID::create(prototype, TypeInfo(ObjectType));
     60    }
     61
    5762protected:
    5863    RuntimeObjectImp(ExecState*, PassRefPtr<StructureID>, PassRefPtr<Bindings::Instance>);
Note: See TracChangeset for help on using the changeset viewer.