Reviewed by Geoff.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Nov 2005 05:40:07 +0000 (05:40 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Nov 2005 05:40:07 +0000 (05:40 +0000)
Updated to use new API to drop all locks.

        * JavaScriptGlue.cpp:
        (JSLockInterpreter):
        (JSUnlockInterpreter):
        * UserObjectImp.cpp:
        (UserObjectImp::callAsFunction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptGlue/ChangeLog
JavaScriptGlue/JavaScriptGlue.cpp
JavaScriptGlue/UserObjectImp.cpp

index 36da2d8..21ca430 100644 (file)
@@ -1,3 +1,15 @@
+2005-11-16  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Geoff.
+
+       Updated to use new API to drop all locks.
+
+        * JavaScriptGlue.cpp:
+        (JSLockInterpreter):
+        (JSUnlockInterpreter):
+        * UserObjectImp.cpp:
+        (UserObjectImp::callAsFunction):
+
 2005-11-14  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by mjs.
index dfe082d..09df020 100644 (file)
@@ -615,11 +615,11 @@ CFMutableArrayRef JSCreateJSArrayFromCFArray(CFArrayRef array)
 
 void JSLockInterpreter()
 {
-    Interpreter::lock();
+    InterpreterLock::lock();
 }
 
 
 void JSUnlockInterpreter()
 {
-    Interpreter::unlock();
+    InterpreterLock::unlock();
 }
index d327f86..fbd86ba 100644 (file)
@@ -72,19 +72,15 @@ ValueImp *UserObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, con
             }
         }
 
-        int lockCount = Interpreter::lockCount();
-        int i;
-        for (i = 0; i < lockCount; i++) {
-            Interpreter::unlock();
-        }
-
-        // implementsCall should have guarded against a NULL fJSUserObject.
-        assert(fJSUserObject);
-        JSUserObject* jsResult = fJSUserObject->CallFunction(jsThisObj, jsArgs);
+        JSUserObject* jsResult;
+        { // scope
+            InterpreterLock::DropAllLocks dropLocks;
 
-        for (i = 0; i < lockCount; i++) {
-            Interpreter::lock();
+            // implementsCall should have guarded against a NULL fJSUserObject.
+            assert(fJSUserObject);
+            jsResult = fJSUserObject->CallFunction(jsThisObj, jsArgs);
         }
+
         if (jsResult) {
             result = JSObjectKJSValue(jsResult);
             jsResult->Release();