Changeset 35478 in webkit for trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
- Timestamp:
- Jul 31, 2008, 5:19:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r35411 r35478 31 31 #include "JSClassRef.h" 32 32 #include "JSGlobalObject.h" 33 #include "JSLock.h"34 33 #include "JSObjectRef.h" 35 34 #include "JSString.h" … … 74 73 // initialize from base to derived 75 74 for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) { 76 JSLock::DropAllLocks dropAllLocks(exec);77 75 JSObjectInitializeCallback initialize = initRoutines[i]; 78 76 initialize(toRef(exec), toRef(this)); … … 113 111 // optional optimization to bypass getProperty in cases when we only need to know if the property exists 114 112 if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { 115 JSLock::DropAllLocks dropAllLocks(exec);116 113 if (hasProperty(ctx, thisRef, propertyNameRef)) { 117 114 slot.setCustom(this, callbackGetter); … … 119 116 } 120 117 } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 121 JSLock::DropAllLocks dropAllLocks(exec);122 118 if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) { 123 119 // cache the value so we don't have to compute it again … … 163 159 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 164 160 if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { 165 JSLock::DropAllLocks dropAllLocks(exec);166 161 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 167 162 return; … … 173 168 return; 174 169 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { 175 JSLock::DropAllLocks dropAllLocks(exec);176 170 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 177 171 return; … … 209 203 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 210 204 if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { 211 JSLock::DropAllLocks dropAllLocks(exec);212 205 if (deleteProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 213 206 return true; … … 264 257 for (int i = 0; i < argumentCount; i++) 265 258 arguments[i] = toRef(args.at(exec, i)); 266 JSLock::DropAllLocks dropAllLocks(exec);267 259 return toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 268 260 } … … 289 281 JSObjectRef thisRef = toRef(this); 290 282 291 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 292 if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) { 293 JSLock::DropAllLocks dropAllLocks(exec); 283 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 284 if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) 294 285 return hasInstance(execRef, thisRef, toRef(value), toRef(exec->exceptionSlot())); 295 } 296 286 } 297 287 ASSERT_NOT_REACHED(); // implementsHasInstance should prevent us from reaching here 298 288 return 0; … … 324 314 for (int i = 0; i < argumentCount; i++) 325 315 arguments[i] = toRef(args.at(exec, i)); 326 JSLock::DropAllLocks dropAllLocks(exec);327 316 return toJS(callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 328 317 } … … 340 329 341 330 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 342 if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) { 343 JSLock::DropAllLocks dropAllLocks(exec); 331 if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) 344 332 getPropertyNames(execRef, thisRef, toRef(&propertyNames)); 345 }346 333 347 334 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { … … 384 371 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 385 372 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 386 JSLock::DropAllLocks dropAllLocks(exec);387 373 if (JSValueRef value = convertToType(ctx, thisRef, kJSTypeNumber, toRef(exec->exceptionSlot()))) 388 374 return toJS(value)->getNumber(); … … 400 386 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 401 387 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 402 JSValueRef value; 403 { 404 JSLock::DropAllLocks dropAllLocks(exec); 405 value = convertToType(ctx, thisRef, kJSTypeString, toRef(exec->exceptionSlot())); 406 } 388 JSValueRef value = convertToType(ctx, thisRef, kJSTypeString, toRef(exec->exceptionSlot())); 407 389 if (value) 408 390 return toJS(value)->getString(); … … 455 437 if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) 456 438 if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { 457 JSLock::DropAllLocks dropAllLocks(exec);458 439 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 459 440 return toJS(value); … … 500 481 for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass) 501 482 if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 502 JSLock::DropAllLocks dropAllLocks(exec);503 483 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 504 484 return toJS(value);
Note:
See TracChangeset
for help on using the changeset viewer.