Changeset 32652 in webkit for trunk/JavaScriptCore/kjs/object.h


Ignore:
Timestamp:
Apr 28, 2008, 11:22:14 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Fix run-webkit-tests --threading
and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
Proxy server issue in Sunday's Nightly

Changed ClassInfo objects for built-in objects to hold a getter function returning
a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
and these are the only ones that need to be shared.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/object.h

    r32587 r32652  
    6666    /**
    6767     * Static hash-table of properties.
    68      */
    69     const HashTable* propHashTable;
     68     * For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value.
     69     */
     70    const HashTable* propHashTable(ExecState* exec) const
     71    {
     72        if (classPropHashTableGetterFunction)
     73            return classPropHashTableGetterFunction(exec);
     74        return staticPropHashTable;
     75    }
     76
     77    const HashTable* staticPropHashTable;
     78    typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
     79    const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
    7080  };
    7181 
     
    146156     *
    147157     * \code
    148      *   const ClassInfo BarImp::info = { "Bar", 0, 0 }; // no parent class
    149      *   const ClassInfo FooImp::info = { "Foo", &BarImp::info, 0 };
     158     *   const ClassInfo BarImp::info = { "Bar", 0, 0, 0 }; // no parent class
     159     *   const ClassInfo FooImp::info = { "Foo", &BarImp::info, 0, 0 };
    150160     * \endcode
    151161     *
     
    410420    virtual JSGlobalObject* toGlobalObject(ExecState*) const;
    411421
    412     virtual bool getPropertyAttributes(const Identifier& propertyName, unsigned& attributes) const;
     422    virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const;
    413423   
    414424    // WebCore uses this to make document.all and style.filter undetectable
     
    444454
    445455  private:
    446     const HashEntry* findPropertyHashEntry( const Identifier& propertyName ) const;
     456    const HashEntry* findPropertyHashEntry(ExecState*, const Identifier& propertyName) const;
    447457    JSValue *_proto;
    448458  };
Note: See TracChangeset for help on using the changeset viewer.