Ignore:
Timestamp:
Jul 23, 2008, 3:15:16 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

JSClassRef is created context-free, but gets infatuated with the first context it sees.

The implicit API contract is that JSClassRef can be used with any context on any thread.
This no longer worked, because UStrings in the class were turned into per-context
identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.

File:
1 edited

Legend:

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

    r35291 r35293  
    9696UString JSCallbackObject<Base>::className() const
    9797{
    98     if (!m_class->className.isNull())
    99         return m_class->className;
     98    UString thisClassName = m_class->className();
     99    if (!thisClassName.isNull())
     100        return thisClassName;
    100101   
    101102    return Base::className();
     
    128129        }
    129130       
    130         if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues) {
     131        if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
    131132            if (staticValues->contains(propertyName.ustring().rep())) {
    132133                slot.setCustom(this, staticValueGetter);
     
    135136        }
    136137       
    137         if (OpaqueJSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) {
     138        if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
    138139            if (staticFunctions->contains(propertyName.ustring().rep())) {
    139140                slot.setCustom(this, staticFunctionGetter);
     
    167168        }
    168169       
    169         if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues) {
     170        if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
    170171            if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) {
    171172                if (entry->attributes & kJSPropertyAttributeReadOnly)
     
    180181        }
    181182       
    182         if (OpaqueJSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) {
     183        if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
    183184            if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
    184185                if (entry->attributes & kJSPropertyAttributeReadOnly)
     
    213214        }
    214215       
    215         if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues) {
     216        if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
    216217            if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) {
    217218                if (entry->attributes & kJSPropertyAttributeDontDelete)
     
    221222        }
    222223       
    223         if (OpaqueJSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) {
     224        if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
    224225            if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
    225226                if (entry->attributes & kJSPropertyAttributeDontDelete)
     
    344345        }
    345346       
    346         if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues) {
    347             typedef OpaqueJSClass::StaticValuesTable::const_iterator iterator;
     347        if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
     348            typedef OpaqueJSClassStaticValuesTable::const_iterator iterator;
    348349            iterator end = staticValues->end();
    349350            for (iterator it = staticValues->begin(); it != end; ++it) {
     
    355356        }
    356357       
    357         if (OpaqueJSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) {
    358             typedef OpaqueJSClass::StaticFunctionsTable::const_iterator iterator;
     358        if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
     359            typedef OpaqueJSClassStaticFunctionsTable::const_iterator iterator;
    359360            iterator end = staticFunctions->end();
    360361            for (iterator it = staticFunctions->begin(); it != end; ++it) {
     
    451452   
    452453    for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass)
    453         if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues)
     454        if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec))
    454455            if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep()))
    455456                if (JSObjectGetPropertyCallback getProperty = entry->getProperty) {
     
    474475   
    475476    for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass) {
    476         if (OpaqueJSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) {
     477        if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
    477478            if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
    478479                if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
Note: See TracChangeset for help on using the changeset viewer.