Show
Ignore:
Timestamp:
08/20/08 13:23:52 (5 months ago)
Author:
mbensi
Message:

merge with webkit revision 35853

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r440 r447  
    3131#include "JSClassRef.h" 
    3232#include "JSGlobalObject.h" 
     33#include "JSLock.h" 
    3334#include "JSObjectRef.h" 
    3435#include "JSString.h" 
     
    7273    // initialize from base to derived 
    7374    for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) { 
     75        JSLock::DropAllLocks dropAllLocks(exec); 
    7476        JSObjectInitializeCallback initialize = initRoutines[i]; 
    7577        initialize(toRef(exec), toRef(this)); 
     
    109111            if (!propertyNameRef) 
    110112                propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     113            JSLock::DropAllLocks dropAllLocks(exec); 
    111114            if (hasProperty(ctx, thisRef, propertyNameRef.get())) { 
    112115                slot.setCustom(this, callbackGetter); 
     
    116119            if (!propertyNameRef) 
    117120                propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     121            JSLock::DropAllLocks dropAllLocks(exec); 
    118122            if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) { 
    119123                // cache the value so we don't have to compute it again 
     
    161165            if (!propertyNameRef) 
    162166                propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     167            JSLock::DropAllLocks dropAllLocks(exec); 
    163168            if (setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, toRef(exec->exceptionSlot()))) 
    164169                return; 
     
    172177                    if (!propertyNameRef) 
    173178                        propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     179                    JSLock::DropAllLocks dropAllLocks(exec); 
    174180                    if (setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, toRef(exec->exceptionSlot()))) 
    175181                        return; 
     
    209215            if (!propertyNameRef) 
    210216                propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     217            JSLock::DropAllLocks dropAllLocks(exec); 
    211218            if (deleteProperty(ctx, thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 
    212219                return true; 
     
    263270            for (int i = 0; i < argumentCount; i++) 
    264271                arguments[i] = toRef(args.at(exec, i)); 
     272            JSLock::DropAllLocks dropAllLocks(exec); 
    265273            return toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 
    266274        } 
     
    288296     
    289297    for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { 
    290         if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) 
     298        if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) { 
     299            JSLock::DropAllLocks dropAllLocks(exec); 
    291300            return hasInstance(execRef, thisRef, toRef(value), toRef(exec->exceptionSlot())); 
     301        } 
    292302    } 
    293303    ASSERT_NOT_REACHED(); // implementsHasInstance should prevent us from reaching here 
     
    320330            for (int i = 0; i < argumentCount; i++) 
    321331                arguments[i] = toRef(args.at(exec, i)); 
     332            JSLock::DropAllLocks dropAllLocks(exec); 
    322333            return toJS(callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 
    323334        } 
     
    335346     
    336347    for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { 
    337         if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) 
     348        if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) { 
     349            JSLock::DropAllLocks dropAllLocks(exec); 
    338350            getPropertyNames(execRef, thisRef, toRef(&propertyNames)); 
     351        } 
    339352         
    340353        if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { 
     
    377390    for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) 
    378391        if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 
     392            JSLock::DropAllLocks dropAllLocks(exec); 
    379393            if (JSValueRef value = convertToType(ctx, thisRef, kJSTypeNumber, toRef(exec->exceptionSlot()))) 
    380394                return toJS(value)->getNumber(); 
     
    392406    for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) 
    393407        if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 
    394             JSValueRef value = convertToType(ctx, thisRef, kJSTypeString, toRef(exec->exceptionSlot())); 
     408            JSValueRef value; 
     409            { 
     410                JSLock::DropAllLocks dropAllLocks(exec); 
     411                value = convertToType(ctx, thisRef, kJSTypeString, toRef(exec->exceptionSlot())); 
     412            } 
    395413            if (value) 
    396414                return toJS(value)->getString(); 
     
    445463                    if (!propertyNameRef) 
    446464                        propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     465                    JSLock::DropAllLocks dropAllLocks(exec); 
    447466                    if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 
    448467                        return toJS(value); 
     
    491510            if (!propertyNameRef) 
    492511                propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 
     512            JSLock::DropAllLocks dropAllLocks(exec); 
    493513            if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 
    494514                return toJS(value);