[webkit-changes] cvs commit: JavaScriptCore/bindings runtime_root.cpp runtime_root.h

Geoffrey ggaren at opensource.apple.com
Tue Sep 20 17:33:17 PDT 2005


ggaren      05/09/20 17:33:16

  Modified:    .        ChangeLog
               bindings runtime_root.cpp runtime_root.h
  Log:
          - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
            kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
            the installer)
  
          Added InterpreterLocks in some places in the bindings we missed before.
  
          Reviewed by john.
  
          * bindings/runtime_root.cpp:
          (KJS::Bindings::addNativeReference):
          (KJS::Bindings::removeNativeReference):
          (RootObject::removeAllNativeReferences):
          * bindings/runtime_root.h:
          (KJS::Bindings::RootObject::~RootObject):
          (KJS::Bindings::RootObject::setRootObjectImp):
  
  Revision  Changes    Path
  1.832     +18 -0     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.831
  retrieving revision 1.832
  diff -u -r1.831 -r1.832
  --- ChangeLog	21 Sep 2005 00:25:10 -0000	1.831
  +++ ChangeLog	21 Sep 2005 00:33:12 -0000	1.832
  @@ -1,5 +1,23 @@
   2005-09-20  Geoffrey Garen  <ggaren at apple.com>
   
  +        - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
  +          kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
  +          the installer)
  +          
  +        Added InterpreterLocks in some places in the bindings we missed before.
  +        
  +        Reviewed by john.
  +
  +        * bindings/runtime_root.cpp:
  +        (KJS::Bindings::addNativeReference):
  +        (KJS::Bindings::removeNativeReference):
  +        (RootObject::removeAllNativeReferences):
  +        * bindings/runtime_root.h:
  +        (KJS::Bindings::RootObject::~RootObject):
  +        (KJS::Bindings::RootObject::setRootObjectImp):
  +
  +2005-09-20  Geoffrey Garen  <ggaren at apple.com>
  +
           - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
             KJS::InterpreterImp::mark() crash
             
  
  
  
  1.11      +6 -3      JavaScriptCore/bindings/runtime_root.cpp
  
  Index: runtime_root.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/bindings/runtime_root.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- runtime_root.cpp	19 Jul 2005 21:16:49 -0000	1.10
  +++ runtime_root.cpp	21 Sep 2005 00:33:16 -0000	1.11
  @@ -160,7 +160,8 @@
           
           unsigned int numReferences = (unsigned int)CFDictionaryGetValue (referencesDictionary, imp);
           if (numReferences == 0) {
  -	    gcProtect(imp);
  +            InterpreterLock lock;
  +            gcProtect(imp);
               CFDictionaryAddValue (referencesDictionary, imp,  (const void *)1);
           }
           else {
  @@ -179,7 +180,8 @@
       if (referencesDictionary) {
           unsigned int numReferences = (unsigned int)CFDictionaryGetValue (referencesDictionary, imp);
           if (numReferences == 1) {
  -	    gcUnprotect(imp);
  +            InterpreterLock lock;
  +            gcUnprotect(imp);
               CFDictionaryRemoveValue (referencesDictionary, imp);
           }
           else {
  @@ -324,8 +326,9 @@
           allImps = (void **)malloc (sizeof(void *) * count);
           CFDictionaryGetKeysAndValues (referencesDictionary, (const void **)allImps, NULL);
           for(i = 0; i < count; i++) {
  +            InterpreterLock lock;
               ObjectImp *anImp = static_cast<ObjectImp*>(allImps[i]);
  -	    gcUnprotect(anImp);
  +            gcUnprotect(anImp);
           }
           free ((void *)allImps);
           CFDictionaryRemoveAllValues (referencesDictionary);
  
  
  
  1.11      +4 -2      JavaScriptCore/bindings/runtime_root.h
  
  Index: runtime_root.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/bindings/runtime_root.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- runtime_root.h	19 Sep 2005 06:57:26 -0000	1.10
  +++ runtime_root.h	21 Sep 2005 00:33:16 -0000	1.11
  @@ -51,12 +51,14 @@
   public:
       RootObject (const void *nativeHandle) : _nativeHandle(nativeHandle), _imp(0), _interpreter(0) {}
       ~RootObject () {
  -	gcUnprotect(_imp);
  +        InterpreterLock lock;
  +        gcUnprotect(_imp);
       }
       
       void setRootObjectImp (ObjectImp *i) { 
  +        InterpreterLock lock;
           _imp = i;
  -	gcProtect(_imp);
  +        gcProtect(_imp);
       }
       
       ObjectImp *rootObjectImp() const { return _imp; }
  
  
  



More information about the webkit-changes mailing list