Changeset 20104 in webkit for trunk/JavaScriptCore/API
- Timestamp:
- Mar 11, 2007, 4:57:11 PM (18 years ago)
- Location:
- trunk/JavaScriptCore/API
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackConstructor.cpp
r17372 r20104 70 70 for (int i = 0; i < argumentCount; i++) 71 71 arguments[i] = toRef(args[i]); 72 73 JSLock::DropAllLocks dropAllLocks; 72 74 return toJS(m_callback(ctx, thisRef, argumentCount, arguments, toRef(exec->exceptionSlot()))); 73 75 } -
trunk/JavaScriptCore/API/JSCallbackFunction.cpp
r17372 r20104 59 59 for (int i = 0; i < argumentCount; i++) 60 60 arguments[i] = toRef(args[i]); 61 62 JSLock::DropAllLocks dropAllLocks; 61 63 return toJS(m_callback(execRef, thisRef, thisObjRef, argumentCount, arguments, toRef(exec->exceptionSlot()))); 62 64 } -
trunk/JavaScriptCore/API/JSCallbackObject.cpp
r17372 r20104 60 60 // initialize from base to derived 61 61 for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) { 62 JSLock::DropAllLocks dropAllLocks; 62 63 JSObjectInitializeCallback initialize = initRoutines[i]; 63 64 initialize(toRef(exec), toRef(this)); … … 70 71 71 72 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 72 if (JSObjectFinalizeCallback finalize = jsClass->finalize) 73 if (JSObjectFinalizeCallback finalize = jsClass->finalize) { 74 JSLock::DropAllLocks dropAllLocks; 73 75 finalize(thisRef); 76 } 74 77 75 78 JSClassRelease(m_class); … … 93 96 // optional optimization to bypass getProperty in cases when we only need to know if the property exists 94 97 if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { 98 JSLock::DropAllLocks dropAllLocks; 95 99 if (hasProperty(ctx, thisRef, propertyNameRef)) { 96 100 slot.setCustom(this, callbackGetter); … … 98 102 } 99 103 } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 104 JSLock::DropAllLocks dropAllLocks; 100 105 if (JSValueRef value = getProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) { 101 106 // cache the value so we don't have to compute it again … … 139 144 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 140 145 if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { 146 JSLock::DropAllLocks dropAllLocks; 141 147 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 142 148 return; … … 148 154 return; 149 155 if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { 156 JSLock::DropAllLocks dropAllLocks; 150 157 if (setProperty(ctx, thisRef, propertyNameRef, valueRef, toRef(exec->exceptionSlot()))) 151 158 return; … … 181 188 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 182 189 if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { 190 JSLock::DropAllLocks dropAllLocks; 183 191 if (deleteProperty(ctx, thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 184 192 return true; … … 230 238 for (int i = 0; i < argumentCount; i++) 231 239 arguments[i] = toRef(args[i]); 240 JSLock::DropAllLocks dropAllLocks; 232 241 return toJS(callAsConstructor(execRef, thisRef, argumentCount, arguments, toRef(exec->exceptionSlot()))); 233 242 } … … 253 262 254 263 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 255 if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) 264 if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) { 265 JSLock::DropAllLocks dropAllLocks; 256 266 return hasInstance(execRef, thisRef, toRef(value), toRef(exec->exceptionSlot())); 267 } 257 268 258 269 ASSERT(0); // implementsHasInstance should prevent us from reaching here … … 282 293 for (int i = 0; i < argumentCount; i++) 283 294 arguments[i] = toRef(args[i]); 295 JSLock::DropAllLocks dropAllLocks; 284 296 return toJS(callAsFunction(execRef, thisRef, thisObjRef, argumentCount, arguments, toRef(exec->exceptionSlot()))); 285 297 } … … 296 308 297 309 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) { 298 if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) 310 if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) { 311 JSLock::DropAllLocks dropAllLocks; 299 312 getPropertyNames(execRef, thisRef, toRef(&propertyNames)); 313 } 300 314 301 315 if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues) { … … 331 345 332 346 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 333 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) 347 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 348 JSLock::DropAllLocks dropAllLocks; 334 349 if (JSValueRef value = convertToType(ctx, thisRef, kJSTypeNumber, toRef(exec->exceptionSlot()))) 335 350 return toJS(value)->getNumber(); 351 } 336 352 337 353 return JSObject::toNumber(exec); … … 344 360 345 361 for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) 346 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) 362 if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { 363 JSLock::DropAllLocks dropAllLocks; 347 364 if (JSValueRef value = convertToType(ctx, thisRef, kJSTypeString, toRef(exec->exceptionSlot()))) 348 365 return toJS(value)->getString(); 366 } 349 367 350 368 return JSObject::toString(exec); … … 388 406 if (OpaqueJSClass::StaticValuesTable* staticValues = jsClass->staticValues) 389 407 if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) 390 if (JSObjectGetPropertyCallback getProperty = entry->getProperty) 408 if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { 409 JSLock::DropAllLocks dropAllLocks; 391 410 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 392 411 return toJS(value); 412 } 393 413 394 414 return throwError(exec, ReferenceError, "Static value property defined with NULL getProperty callback."); … … 427 447 428 448 for (JSClassRef jsClass = thisObj->m_class; jsClass; jsClass = jsClass->parentClass) 429 if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) 449 if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { 450 JSLock::DropAllLocks dropAllLocks; 430 451 if (JSValueRef value = getProperty(toRef(exec), thisRef, propertyNameRef, toRef(exec->exceptionSlot()))) 431 452 return toJS(value); 453 } 432 454 433 455 return throwError(exec, ReferenceError, "hasProperty callback returned true for a property that doesn't exist.");
Note:
See TracChangeset
for help on using the changeset viewer.