Changeset 447 for trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
- Timestamp:
- 08/20/08 13:23:52 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r440 r447 31 31 #include "JSClassRef.h" 32 32 #include "JSGlobalObject.h" 33 #include "JSLock.h" 33 34 #include "JSObjectRef.h" 34 35 #include "JSString.h" … … 72 73 // initialize from base to derived 73 74 for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) { 75 JSLock::DropAllLocks dropAllLocks(exec); 74 76 JSObjectInitializeCallback initialize = initRoutines[i]; 75 77 initialize(toRef(exec), toRef(this)); … … 109 111 if (!propertyNameRef) 110 112 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 113 JSLock::DropAllLocks dropAllLocks(exec); 111 114 if (hasProperty(ctx, thisRef, propertyNameRef.get())) { 112 115 slot.setCustom(this, callbackGetter); … … 116 119 if (!propertyNameRef) 117 120 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 121 JSLock::DropAllLocks dropAllLocks(exec); 118 122 if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) { 119 123 // cache the value so we don't have to compute it again … … 161 165 if (!propertyNameRef) 162 166 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 167 JSLock::DropAllLocks dropAllLocks(exec); 163 168 if (setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, toRef(exec->exceptionSlot()))) 164 169 return; … … 172 177 if (!propertyNameRef) 173 178 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 179 JSLock::DropAllLocks dropAllLocks(exec); 174 180 if (setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, toRef(exec->exceptionSlot()))) 175 181 return; … … 209 215 if (!propertyNameRef) 210 216 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 217 JSLock::DropAllLocks dropAllLocks(exec); 211 218 if (deleteProperty(ctx, thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 212 219 return true; … … 263 270 for (int i = 0; i < argumentCount; i++) 264 271 arguments[i] = toRef(args.at(exec, i)); 272 JSLock::DropAllLocks dropAllLocks(exec); 265 273 return toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 266 274 } … … 288 296 289 297 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); 291 300 return hasInstance(execRef, thisRef, toRef(value), toRef(exec->exceptionSlot())); 301 } 292 302 } 293 303 ASSERT_NOT_REACHED(); // implementsHasInstance should prevent us from reaching here … … 320 330 for (int i = 0; i < argumentCount; i++) 321 331 arguments[i] = toRef(args.at(exec, i)); 332 JSLock::DropAllLocks dropAllLocks(exec); 322 333 return toJS(callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), toRef(exec->exceptionSlot()))); 323 334 } … … 335 346 336 347 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); 338 350 getPropertyNames(execRef, thisRef, toRef(&propertyNames)); 351 } 339 352 340 353 if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { … … 377 390 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) 378 391 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 392 JSLock::DropAllLocks dropAllLocks(exec); 379 393 if (JSValueRef value = convertToType(ctx, thisRef, kJSTypeNumber, toRef(exec->exceptionSlot()))) 380 394 return toJS(value)->getNumber(); … … 392 406 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) 393 407 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 } 395 413 if (value) 396 414 return toJS(value)->getString(); … … 445 463 if (!propertyNameRef) 446 464 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 465 JSLock::DropAllLocks dropAllLocks(exec); 447 466 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 448 467 return toJS(value); … … 491 510 if (!propertyNameRef) 492 511 propertyNameRef = OpaqueJSString::create(propertyName.ustring()); 512 JSLock::DropAllLocks dropAllLocks(exec); 493 513 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), toRef(exec->exceptionSlot()))) 494 514 return toJS(value);
