[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:19:19 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8482bd2a8d4f4527bcda68b5bba0baf6487a191e
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 16 06:24:55 2003 +0000

    	Fixed a couple of snafus and removed some logging.
    
            Reviewed by Maciej.
    
            * bindings/jni_jsobject.cpp:
            (Bindings::performJavaScriptAccess):
            (Bindings::completedJavaScriptAccess):
            (Bindings::dispatchToJavaScriptThread):
    	Removed some annoying JS_LOG clutter.
    
            (Bindings::RootObject::removeAllJavaReferencesForRoot):
    	Fixed allocation of key buffer that was called after it was needed.
    
            (Bindings::JSObject::invoke):
            (Bindings::JSObject::JSObject):
            (Bindings::JSObject::getMember):
            (Bindings::JSObject::getSlot):
    	Added additional interpreter locks around getMember and getSlot.
    	These functions may cause allocation of JS impls.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5804 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 0313234..611d2c8 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,27 @@
 2003-12-15  Richard Williamson   <rjw at apple.com>
 
+	Fixed a couple of snafus and removed some logging.
+
+        Reviewed by Maciej.
+
+        * bindings/jni_jsobject.cpp:
+        (Bindings::performJavaScriptAccess):
+        (Bindings::completedJavaScriptAccess):
+        (Bindings::dispatchToJavaScriptThread):
+	Removed some annoying JS_LOG clutter.
+
+        (Bindings::RootObject::removeAllJavaReferencesForRoot):
+	Fixed allocation of key buffer that was called after it was needed.
+
+        (Bindings::JSObject::invoke):
+        (Bindings::JSObject::JSObject):
+        (Bindings::JSObject::getMember):
+        (Bindings::JSObject::getSlot):
+	Added additional interpreter locks around getMember and getSlot. 
+	These functions may cause allocation of JS impls.  
+
+2003-12-15  Richard Williamson   <rjw at apple.com>
+
 	args weren't passed to 'call' invocation.  d'oh.
 	lock interpreter when we create instances of JS impls.	
 
diff --git a/JavaScriptCore/bindings/jni_jsobject.cpp b/JavaScriptCore/bindings/jni_jsobject.cpp
index 562fb04..d0f3ab4 100644
--- a/JavaScriptCore/bindings/jni_jsobject.cpp
+++ b/JavaScriptCore/bindings/jni_jsobject.cpp
@@ -189,8 +189,6 @@ static void performJavaScriptAccess(void *info);
 static void performJavaScriptAccess(void *i)
 {
     assert (CFRunLoopGetCurrent() == RootObject::runLoop());
-
-    JS_LOG ("completionSource = %p\n", completionSource);
     
     // Dispatch JavaScript calls here.
     CFRunLoopSourceContext sourceContext;
@@ -200,8 +198,6 @@ static void performJavaScriptAccess(void *i)
 
     JSObject::invoke (callContext);
     
-    JS_LOG ("originatingLoop = %p\n", originatingLoop);
-
     // Signal the originating thread that we're done.
     CFRunLoopSourceSignal (completionSource);
     if (CFRunLoopIsWaiting(originatingLoop)) {
@@ -219,7 +215,6 @@ static void completedJavaScriptAccess (void *i)
 
     assert (CFRunLoopGetCurrent() == runLoop);
 
-    JS_LOG ("runLoop = %p\n", runLoop);
     CFRunLoopStop(runLoop);
 }
 
@@ -275,8 +270,6 @@ static void dispatchToJavaScriptThread(JSObjectCallContext *context)
     completionSource = CFRunLoopSourceCreate(NULL, 0, &sourceContext);
     CFRunLoopAddSource(currentRunLoop, completionSource, kCFRunLoopDefaultMode);
 
-    JS_LOG ("signalling, completionSource = %p\n", completionSource);
-
     // Wakeup JavaScript access thread and make it do it's work.
     CFRunLoopSourceSignal(RootObject::performJavaScriptSource());
     if (CFRunLoopIsWaiting(RootObject::runLoop())) {
@@ -289,8 +282,6 @@ static void dispatchToJavaScriptThread(JSObjectCallContext *context)
     CFRunLoopRemoveSource(currentRunLoop, completionSource, kCFRunLoopDefaultMode);
     CFRelease (completionSource);
 
-    JS_LOG ("done\n");
-
     unlockJavaScriptAccess();
 }
 
@@ -326,8 +317,8 @@ void RootObject::removeAllJavaReferencesForRoot (Bindings::RootObject *root)
         CFIndex count, i;
         
         count = CFDictionaryGetCount(referencesDictionary);
-        CFDictionaryGetKeysAndValues (referencesDictionary, (const void **)allImps, NULL);
         allImps = (void **)malloc (sizeof(void *) * count);
+        CFDictionaryGetKeysAndValues (referencesDictionary, (const void **)allImps, NULL);
         for(i = 0; i < count; i++) {
             ObjectImp *anImp = static_cast<ObjectImp*>(allImps[i]);
             anImp->deref();
@@ -353,6 +344,11 @@ jvalue JSObject::invoke (JSObjectCallContext *context)
     }
     else {
         jlong nativeHandle = context->nativeHandle;
+        if (nativeHandle == UndefinedHandle || nativeHandle == 0) {
+            bzero ((void *)&result, sizeof(jvalue));
+            return result;
+        }
+
         switch (context->type){
             case CreateNative: {
                 result.j = JSObject::createNative(nativeHandle);
@@ -417,8 +413,7 @@ JSObject::JSObject(jlong nativeJSObject)
     // terribly wrong.
     assert (_imp != 0);
     
-    // Find the root (window) object associated with the imp.
-    _root = rootForImp (_imp);
+    _root = rootForImp(_imp);
     
     // If we can't find the root for the object something is terrible wrong.
     assert (_root != 0);
@@ -458,10 +453,13 @@ jobject JSObject::eval(jstring script) const
 
 jobject JSObject::getMember(jstring memberName) const
 {
-    JS_LOG ("memberName = %s\n", JavaString(memberName).characters());
+    JS_LOG ("(%p) memberName = %s\n", _imp, JavaString(memberName).characters());
 
     ExecState *exec = _root->interpreter()->globalExec();
+
+    _root->interpreter()->lock();
     Value result = _imp->get (exec, Identifier (JavaString(memberName).ustring()));
+    _root->interpreter()->unlock();
 
     return convertValueToJObject (result);
 }
@@ -488,7 +486,9 @@ jobject JSObject::getSlot(jint index) const
     JS_LOG ("index = %d\n", index);
 
     ExecState *exec = _root->interpreter()->globalExec();
+    _root->interpreter()->lock();
     Value result = _imp->get (exec, (unsigned)index);
+    _root->interpreter()->unlock();
 
     return convertValueToJObject (result);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list