Bug 714418 - Remove nsIXPCScriptable::DONT_SHARE_PROTOTYPE (r=bholley, sr=mrbkap)
authorBill McCloskey <wmccloskey@mozilla.com>
Wed, 04 Jan 2012 14:13:20 -0800
changeset 85038 1dc627b6158d0ecbc231dab918df24d941a9d772
parent 85037 99d43af273a8d2560d63896488252775be639c53
child 85039 6c67d9517dbb04ca590f43ca00f175a6aed99b0e
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, mrbkap
bugs714418
milestone12.0a1
Bug 714418 - Remove nsIXPCScriptable::DONT_SHARE_PROTOTYPE (r=bholley, sr=mrbkap)
js/xpconnect/idl/nsIXPCScriptable.idl
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/XPCWrappedNativeProto.cpp
js/xpconnect/src/XPCWrappedNativeScope.cpp
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/xpcprivate.h
--- a/js/xpconnect/idl/nsIXPCScriptable.idl
+++ b/js/xpconnect/idl/nsIXPCScriptable.idl
@@ -96,17 +96,16 @@ interface nsIXPCScriptable : nsISupports
     const PRUint32 USE_JSSTUB_FOR_DELPROPERTY       = 1 << 18;
     const PRUint32 USE_JSSTUB_FOR_SETPROPERTY       = 1 << 19;
     const PRUint32 DONT_ENUM_STATIC_PROPS           = 1 << 20;
     const PRUint32 DONT_ENUM_QUERY_INTERFACE        = 1 << 21;
     const PRUint32 DONT_ASK_INSTANCE_FOR_SCRIPTABLE = 1 << 22;
     const PRUint32 CLASSINFO_INTERFACES_ONLY        = 1 << 23;
     const PRUint32 ALLOW_PROP_MODS_DURING_RESOLVE   = 1 << 24;
     const PRUint32 ALLOW_PROP_MODS_TO_PROTOTYPE     = 1 << 25;
-    const PRUint32 DONT_SHARE_PROTOTYPE             = 1 << 26;
     const PRUint32 DONT_REFLECT_INTERFACE_NAMES     = 1 << 27;
     const PRUint32 WANT_EQUALITY                    = 1 << 28;
     const PRUint32 WANT_OUTER_OBJECT                = 1 << 29;
     const PRUint32 USE_STUB_EQUALITY_HOOK           = 1 << 30;
 
     // The high order bit is RESERVED for consumers of these flags. 
     // No implementor of this interface should ever return flags 
     // with this bit set.
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -522,18 +522,17 @@ XPCWrappedNative::GetNewOrUsed(XPCCallCo
 
     // If there is ClassInfo (and we are not building a wrapper for the
     // nsIClassInfo interface) then we use a wrapper that needs a prototype.
 
     // Note that the security check happens inside FindTearOff - after the
     // wrapper is actually created, but before JS code can see it.
 
     if (info && !isClassInfo) {
-        proto = XPCWrappedNativeProto::GetNewOrUsed(ccx, Scope, info, &sciProto,
-                                                    false, isGlobal);
+        proto = XPCWrappedNativeProto::GetNewOrUsed(ccx, Scope, info, &sciProto, isGlobal);
         if (!proto)
             return NS_ERROR_FAILURE;
 
         proto->CacheOffsets(identity);
 
         wrapper = new XPCWrappedNative(identity, proto);
         if (!wrapper)
             return NS_ERROR_FAILURE;
@@ -1023,60 +1022,49 @@ XPCWrappedNative::GatherScriptableCreate
 
         NS_ASSERTION(!(sciWrapper.GetFlags().WantPreCreate() &&
                        !sciProto.GetFlags().WantPreCreate()),
                      "Can't set WANT_PRECREATE on an instance scriptable "
                      "without also setting it on the class scriptable");
 
         NS_ASSERTION(!(sciWrapper.GetFlags().DontEnumStaticProps() &&
                        !sciProto.GetFlags().DontEnumStaticProps() &&
-                       sciProto.GetCallback() &&
-                       !sciProto.GetFlags().DontSharePrototype()),
+                       sciProto.GetCallback()),
                      "Can't set DONT_ENUM_STATIC_PROPS on an instance scriptable "
                      "without also setting it on the class scriptable (if present and shared)");
 
         NS_ASSERTION(!(sciWrapper.GetFlags().DontEnumQueryInterface() &&
                        !sciProto.GetFlags().DontEnumQueryInterface() &&
-                       sciProto.GetCallback() &&
-                       !sciProto.GetFlags().DontSharePrototype()),
+                       sciProto.GetCallback()),
                      "Can't set DONT_ENUM_QUERY_INTERFACE on an instance scriptable "
                      "without also setting it on the class scriptable (if present and shared)");
 
         NS_ASSERTION(!(sciWrapper.GetFlags().DontAskInstanceForScriptable() &&
                        !sciProto.GetFlags().DontAskInstanceForScriptable()),
                      "Can't set DONT_ASK_INSTANCE_FOR_SCRIPTABLE on an instance scriptable "
                      "without also setting it on the class scriptable");
 
         NS_ASSERTION(!(sciWrapper.GetFlags().ClassInfoInterfacesOnly() &&
                        !sciProto.GetFlags().ClassInfoInterfacesOnly() &&
-                       sciProto.GetCallback() &&
-                       !sciProto.GetFlags().DontSharePrototype()),
+                       sciProto.GetCallback()),
                      "Can't set CLASSINFO_INTERFACES_ONLY on an instance scriptable "
                      "without also setting it on the class scriptable (if present and shared)");
 
         NS_ASSERTION(!(sciWrapper.GetFlags().AllowPropModsDuringResolve() &&
                        !sciProto.GetFlags().AllowPropModsDuringResolve() &&
-                       sciProto.GetCallback() &&
-                       !sciProto.GetFlags().DontSharePrototype()),
+                       sciProto.GetCallback()),
                      "Can't set ALLOW_PROP_MODS_DURING_RESOLVE on an instance scriptable "
                      "without also setting it on the class scriptable (if present and shared)");
 
         NS_ASSERTION(!(sciWrapper.GetFlags().AllowPropModsToPrototype() &&
                        !sciProto.GetFlags().AllowPropModsToPrototype() &&
-                       sciProto.GetCallback() &&
-                       !sciProto.GetFlags().DontSharePrototype()),
+                       sciProto.GetCallback()),
                      "Can't set ALLOW_PROP_MODS_TO_PROTOTYPE on an instance scriptable "
                      "without also setting it on the class scriptable (if present and shared)");
 
-        NS_ASSERTION(!(sciWrapper.GetFlags().DontSharePrototype() &&
-                       !sciProto.GetFlags().DontSharePrototype() &&
-                       sciProto.GetCallback()),
-                     "Can't set DONT_SHARE_PROTOTYPE on an instance scriptable "
-                     "without also setting it on the class scriptable (if present and shared)");
-
         return sciWrapper;
     }
 
     return sciProto;
 }
 
 #ifdef DEBUG_slimwrappers
 static PRUint32 sMorphedSlimWrappers;
@@ -1096,23 +1084,16 @@ XPCWrappedNative::Init(XPCCallContext& c
                 mScriptableInfo = siProto;
         }
         if (!mScriptableInfo) {
             mScriptableInfo =
                 XPCNativeScriptableInfo::Construct(ccx, isGlobal, sci);
 
             if (!mScriptableInfo)
                 return false;
-
-            // If we have a one-off proto, then it should share our scriptable.
-            // This allows the proto's JSClass callbacks to do the right things
-            // (like respecting the DONT_ENUM_STATIC_PROPS flag) w/o requiring
-            // scriptable objects to have an nsIClassInfo.
-            if (HasProto() && !HasSharedProto())
-                GetProto()->SetScriptableInfo(mScriptableInfo);
         }
     }
     XPCNativeScriptableInfo* si = mScriptableInfo;
 
     // create our flatJSObject
 
     JSClass* jsclazz = si ? si->GetJSClass() : Jsvalify(&XPC_WN_NoHelper_JSClass);
 
@@ -1497,17 +1478,16 @@ XPCWrappedNative::ReparentWrapperIfFound
 
         if (oldProto) {
             XPCNativeScriptableInfo *info = oldProto->GetScriptableInfo();
             XPCNativeScriptableCreateInfo ci(*info);
             newProto =
                 XPCWrappedNativeProto::GetNewOrUsed(ccx, aNewScope,
                                                     oldProto->GetClassInfo(),
                                                     &ci,
-                                                    !oldProto->IsShared(),
                                                     (info->GetJSClass()->flags & JSCLASS_IS_GLOBAL),
                                                     oldProto->GetOffsetsMasked());
             if (!newProto) {
                 return NS_ERROR_FAILURE;
             }
         }
 
         if (wrapper) {
@@ -3030,17 +3010,16 @@ NS_IMETHODIMP XPCWrappedNative::RefreshP
 
     oldProto = GetProto();
 
     XPCNativeScriptableInfo *info = oldProto->GetScriptableInfo();
     XPCNativeScriptableCreateInfo ci(*info);
     newProto = XPCWrappedNativeProto::GetNewOrUsed(ccx, oldProto->GetScope(),
                                                    oldProto->GetClassInfo(),
                                                    &ci,
-                                                   !oldProto->IsShared(),
                                                    (info->GetJSClass()->flags & JSCLASS_IS_GLOBAL),
                                                    oldProto->GetOffsetsMasked());
     if (!newProto)
         return UnexpectedFailure(NS_ERROR_FAILURE);
 
     // If nothing needs to change then we're done.
 
     if (newProto.get() == oldProto.get())
@@ -3719,17 +3698,17 @@ ConstructSlimWrapper(XPCCallContext &ccx
     PRUint32 interfacesBitmap = classInfoHelper->GetInterfacesBitmap();
     XPCNativeScriptableCreateInfo
         sciProto(aHelper.forgetXPCClassInfo(), flags, interfacesBitmap);
 
     AutoMarkingWrappedNativeProtoPtr xpcproto(ccx);
     JSBool isGlobal = false;
     xpcproto = XPCWrappedNativeProto::GetNewOrUsed(ccx, xpcScope,
                                                    classInfoHelper, &sciProto,
-                                                   false, isGlobal);
+                                                   isGlobal);
     if (!xpcproto)
         return false;
 
     xpcproto->CacheOffsets(identityObj);
 
     XPCNativeScriptableInfo* si = xpcproto->GetScriptableInfo();
     JSClass* jsclazz = si->GetSlimJSClass();
     if (!jsclazz)
--- a/js/xpconnect/src/XPCWrappedNativeProto.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp
@@ -33,17 +33,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-/* Possibly shared proto object for XPCWrappedNative. */
+/* Shared proto object for XPCWrappedNative. */
 
 #include "xpcprivate.h"
 
 #if defined(DEBUG_xpc_hacker) || defined(DEBUG)
 PRInt32 XPCWrappedNativeProto::gDEBUG_LiveProtoCount = 0;
 #endif
 
 XPCWrappedNativeProto::XPCWrappedNativeProto(XPCWrappedNativeScope* Scope,
@@ -147,23 +147,21 @@ XPCWrappedNativeProto::Init(XPCCallConte
 
 void
 XPCWrappedNativeProto::JSProtoObjectFinalized(JSContext *cx, JSObject *obj)
 {
     NS_ASSERTION(obj == mJSProtoObject, "huh?");
 
     // Map locking is not necessary since we are running gc.
 
-    if (IsShared()) {
-        // Only remove this proto from the map if it is the one in the map.
-        ClassInfo2WrappedNativeProtoMap* map =
-            GetScope()->GetWrappedNativeProtoMap(ClassIsMainThreadOnly());
-        if (map->Find(mClassInfo) == this)
-            map->Remove(mClassInfo);
-    }
+    // Only remove this proto from the map if it is the one in the map.
+    ClassInfo2WrappedNativeProtoMap* map =
+        GetScope()->GetWrappedNativeProtoMap(ClassIsMainThreadOnly());
+    if (map->Find(mClassInfo) == this)
+        map->Remove(mClassInfo);
 
     GetRuntime()->GetDetachedWrappedNativeProtoMap()->Remove(this);
     GetRuntime()->GetDyingWrappedNativeProtoMap()->Add(this);
 
     mJSProtoObject.finalize(cx);
 }
 
 void
@@ -186,77 +184,58 @@ XPCWrappedNativeProto::SystemIsBeingShut
         JS_SetPrivate(cx, mJSProtoObject, nsnull);
         mJSProtoObject = nsnull;
     }
 }
 
 // static
 XPCWrappedNativeProto*
 XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext& ccx,
-                                    XPCWrappedNativeScope* Scope,
-                                    nsIClassInfo* ClassInfo,
-                                    const XPCNativeScriptableCreateInfo* ScriptableCreateInfo,
-                                    JSBool ForceNoSharing,
+                                    XPCWrappedNativeScope* scope,
+                                    nsIClassInfo* classInfo,
+                                    const XPCNativeScriptableCreateInfo* scriptableCreateInfo,
                                     JSBool isGlobal,
                                     QITableEntry* offsets)
 {
-    NS_ASSERTION(Scope, "bad param");
-    NS_ASSERTION(ClassInfo, "bad param");
+    NS_ASSERTION(scope, "bad param");
+    NS_ASSERTION(classInfo, "bad param");
 
     AutoMarkingWrappedNativeProtoPtr proto(ccx);
     ClassInfo2WrappedNativeProtoMap* map = nsnull;
     XPCLock* lock = nsnull;
-    JSBool shared;
 
     uint32_t ciFlags;
-    if (NS_FAILED(ClassInfo->GetFlags(&ciFlags)))
+    if (NS_FAILED(classInfo->GetFlags(&ciFlags)))
         ciFlags = 0;
 
-    if (ciFlags & XPC_PROTO_DONT_SHARE) {
-        NS_ERROR("reserved flag set!");
-        ciFlags &= ~XPC_PROTO_DONT_SHARE;
-    }
-
-    if (ForceNoSharing || (ciFlags & nsIClassInfo::PLUGIN_OBJECT) ||
-        (ScriptableCreateInfo &&
-         ScriptableCreateInfo->GetFlags().DontSharePrototype())) {
-        ciFlags |= XPC_PROTO_DONT_SHARE;
-        shared = false;
-    } else {
-        shared = true;
-    }
-
-    if (shared) {
-        JSBool mainThreadOnly = !!(ciFlags & nsIClassInfo::MAIN_THREAD_ONLY);
-        map = Scope->GetWrappedNativeProtoMap(mainThreadOnly);
-        lock = mainThreadOnly ? nsnull : Scope->GetRuntime()->GetMapLock();
-        {   // scoped lock
-            XPCAutoLock al(lock);
-            proto = map->Find(ClassInfo);
-            if (proto)
-                return proto;
-        }
+    JSBool mainThreadOnly = !!(ciFlags & nsIClassInfo::MAIN_THREAD_ONLY);
+    map = scope->GetWrappedNativeProtoMap(mainThreadOnly);
+    lock = mainThreadOnly ? nsnull : scope->GetRuntime()->GetMapLock();
+    {   // scoped lock
+        XPCAutoLock al(lock);
+        proto = map->Find(classInfo);
+        if (proto)
+            return proto;
     }
 
     AutoMarkingNativeSetPtr set(ccx);
-    set = XPCNativeSet::GetNewOrUsed(ccx, ClassInfo);
+    set = XPCNativeSet::GetNewOrUsed(ccx, classInfo);
     if (!set)
         return nsnull;
 
-    proto = new XPCWrappedNativeProto(Scope, ClassInfo, ciFlags, set, offsets);
+    proto = new XPCWrappedNativeProto(scope, classInfo, ciFlags, set, offsets);
 
-    if (!proto || !proto->Init(ccx, isGlobal, ScriptableCreateInfo)) {
+    if (!proto || !proto->Init(ccx, isGlobal, scriptableCreateInfo)) {
         delete proto.get();
         return nsnull;
     }
 
-    if (shared)
     {   // scoped lock
         XPCAutoLock al(lock);
-        map->Add(ClassInfo, proto);
+        map->Add(classInfo, proto);
     }
 
     return proto;
 }
 
 void
 XPCWrappedNativeProto::DebugDump(PRInt16 depth)
 {
--- a/js/xpconnect/src/XPCWrappedNativeScope.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp
@@ -554,47 +554,44 @@ XPCWrappedNativeScope::KillDyingScopes()
     }
     gDyingScopes = nsnull;
 }
 
 struct ShutdownData
 {
     ShutdownData(JSContext* acx)
         : cx(acx), wrapperCount(0),
-          sharedProtoCount(0), nonSharedProtoCount(0) {}
+          protoCount(0) {}
     JSContext* cx;
     int wrapperCount;
-    int sharedProtoCount;
-    int nonSharedProtoCount;
+    int protoCount;
 };
 
 static JSDHashOperator
 WrappedNativeShutdownEnumerator(JSDHashTable *table, JSDHashEntryHdr *hdr,
                                 uint32_t number, void *arg)
 {
     ShutdownData* data = (ShutdownData*) arg;
     XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;
 
     if (wrapper->IsValid()) {
-        if (wrapper->HasProto() && !wrapper->HasSharedProto())
-            data->nonSharedProtoCount++;
         wrapper->SystemIsBeingShutDown(data->cx);
         data->wrapperCount++;
     }
     return JS_DHASH_REMOVE;
 }
 
 static JSDHashOperator
 WrappedNativeProtoShutdownEnumerator(JSDHashTable *table, JSDHashEntryHdr *hdr,
                                      uint32_t number, void *arg)
 {
     ShutdownData* data = (ShutdownData*) arg;
     ((ClassInfo2WrappedNativeProtoMap::Entry*)hdr)->value->
         SystemIsBeingShutDown(data->cx);
-    data->sharedProtoCount++;
+    data->protoCount++;
     return JS_DHASH_REMOVE;
 }
 
 //static
 void
 XPCWrappedNativeScope::SystemIsBeingShutDown(JSContext* cx)
 {
     DEBUG_TrackScopeTraversal();
@@ -643,20 +640,19 @@ XPCWrappedNativeScope::SystemIsBeingShut
 
     // Now it is safe to kill all the scopes.
     KillDyingScopes();
 
 #ifdef XPC_DUMP_AT_SHUTDOWN
     if (data.wrapperCount)
         printf("deleting nsXPConnect  with %d live XPCWrappedNatives\n",
                data.wrapperCount);
-    if (data.sharedProtoCount + data.nonSharedProtoCount)
-        printf("deleting nsXPConnect  with %d live XPCWrappedNativeProtos (%d shared)\n",
-               data.sharedProtoCount + data.nonSharedProtoCount,
-               data.sharedProtoCount);
+    if (data.protoCount)
+        printf("deleting nsXPConnect  with %d live XPCWrappedNativeProtos\n",
+               data.protoCount);
     if (liveScopeCount)
         printf("deleting nsXPConnect  with %d live XPCWrappedNativeScopes\n",
                liveScopeCount);
 #endif
 }
 
 
 /***************************************************************************/
@@ -809,37 +805,26 @@ WNProtoSecPolicyClearer(JSDHashTable *ta
                         uint32_t number, void *arg)
 {
     XPCWrappedNativeProto* proto =
         ((ClassInfo2WrappedNativeProtoMap::Entry*)hdr)->value;
     *(proto->GetSecurityInfoAddr()) = nsnull;
     return JS_DHASH_NEXT;
 }
 
-static JSDHashOperator
-WNSecPolicyClearer(JSDHashTable *table, JSDHashEntryHdr *hdr,
-                   uint32_t number, void *arg)
-{
-    XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;
-    if (wrapper->HasProto() && !wrapper->HasSharedProto())
-        *(wrapper->GetProto()->GetSecurityInfoAddr()) = nsnull;
-    return JS_DHASH_NEXT;
-}
-
 // static
 nsresult
 XPCWrappedNativeScope::ClearAllWrappedNativeSecurityPolicies(XPCCallContext& ccx)
 {
     // Hold the lock throughout.
     XPCAutoLock lock(ccx.GetRuntime()->GetMapLock());
 
     for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) {
         cur->mWrappedNativeProtoMap->Enumerate(WNProtoSecPolicyClearer, nsnull);
         cur->mMainThreadWrappedNativeProtoMap->Enumerate(WNProtoSecPolicyClearer, nsnull);
-        cur->mWrappedNativeMap->Enumerate(WNSecPolicyClearer, nsnull);
     }
 
     DEBUG_TrackScopeTraversal();
 
     return NS_OK;
 }
 
 static JSDHashOperator
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -2126,18 +2126,17 @@ nsXPConnect::GetWrappedNativePrototype(J
     if (!scope)
         return UnexpectedFailure(NS_ERROR_FAILURE);
 
     XPCNativeScriptableCreateInfo sciProto;
     XPCWrappedNative::GatherProtoScriptableCreateInfo(aClassInfo, sciProto);
 
     AutoMarkingWrappedNativeProtoPtr proto(ccx);
     proto = XPCWrappedNativeProto::GetNewOrUsed(ccx, scope, aClassInfo,
-                                                &sciProto, false,
-                                                OBJ_IS_NOT_GLOBAL);
+                                                &sciProto, OBJ_IS_NOT_GLOBAL);
     if (!proto)
         return UnexpectedFailure(NS_ERROR_FAILURE);
 
     nsIXPConnectJSObjectHolder* holder;
     *_retval = holder = XPCJSObjectHolder::newHolder(ccx,
                                                      proto->GetJSProtoObject());
     if (!holder)
         return UnexpectedFailure(NS_ERROR_FAILURE);
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2019,17 +2019,16 @@ public:
     JSBool UseJSStubForDelProperty()      GET_IT(USE_JSSTUB_FOR_DELPROPERTY)
     JSBool UseJSStubForSetProperty()      GET_IT(USE_JSSTUB_FOR_SETPROPERTY)
     JSBool DontEnumStaticProps()          GET_IT(DONT_ENUM_STATIC_PROPS)
     JSBool DontEnumQueryInterface()       GET_IT(DONT_ENUM_QUERY_INTERFACE)
     JSBool DontAskInstanceForScriptable() GET_IT(DONT_ASK_INSTANCE_FOR_SCRIPTABLE)
     JSBool ClassInfoInterfacesOnly()      GET_IT(CLASSINFO_INTERFACES_ONLY)
     JSBool AllowPropModsDuringResolve()   GET_IT(ALLOW_PROP_MODS_DURING_RESOLVE)
     JSBool AllowPropModsToPrototype()     GET_IT(ALLOW_PROP_MODS_TO_PROTOTYPE)
-    JSBool DontSharePrototype()           GET_IT(DONT_SHARE_PROTOTYPE)
     JSBool DontReflectInterfaceNames()    GET_IT(DONT_REFLECT_INTERFACE_NAMES)
     JSBool UseStubEqualityHook()          GET_IT(USE_STUB_EQUALITY_HOOK)
 
 #undef GET_IT
 };
 
 /***************************************************************************/
 
@@ -2189,30 +2188,29 @@ public:
 
 private:
     nsCOMPtr<nsIXPCScriptable>  mCallback;
     XPCNativeScriptableFlags    mFlags;
     PRUint32                    mInterfacesBitmap;
 };
 
 /***********************************************/
-// XPCWrappedNativeProto hold the additional (potentially shared) wrapper data
+// XPCWrappedNativeProto hold the additional shared wrapper data
 // for XPCWrappedNative whose native objects expose nsIClassInfo.
 
 #define UNKNOWN_OFFSETS ((QITableEntry*)1)
 
 class XPCWrappedNativeProto
 {
 public:
     static XPCWrappedNativeProto*
     GetNewOrUsed(XPCCallContext& ccx,
-                 XPCWrappedNativeScope* Scope,
-                 nsIClassInfo* ClassInfo,
-                 const XPCNativeScriptableCreateInfo* ScriptableCreateInfo,
-                 JSBool ForceNoSharing,
+                 XPCWrappedNativeScope* scope,
+                 nsIClassInfo* classInfo,
+                 const XPCNativeScriptableCreateInfo* scriptableCreateInfo,
                  JSBool isGlobal,
                  QITableEntry* offsets = UNKNOWN_OFFSETS);
 
     XPCWrappedNativeScope*
     GetScope()   const {return mScope;}
 
     XPCJSRuntime*
     GetRuntime() const {return mScope->GetRuntime();}
@@ -2277,21 +2275,16 @@ public:
     JSBool ClassIsSingleton()           GET_IT(SINGLETON)
     JSBool ClassIsThreadSafe()          GET_IT(THREADSAFE)
     JSBool ClassIsMainThreadOnly()      GET_IT(MAIN_THREAD_ONLY)
     JSBool ClassIsDOMObject()           GET_IT(DOM_OBJECT)
     JSBool ClassIsPluginObject()        GET_IT(PLUGIN_OBJECT)
 
 #undef GET_IT
 
-#define XPC_PROTO_DONT_SHARE JS_BIT(31) // only high bit of 32 is set
-
-    JSBool
-    IsShared() const {return !(mClassInfoFlags & XPC_PROTO_DONT_SHARE);}
-
     XPCLock* GetLock() const
         {return ClassIsThreadSafe() ? GetRuntime()->GetMapLock() : nsnull;}
 
     void SetScriptableInfo(XPCNativeScriptableInfo* si)
         {NS_ASSERTION(!mScriptableInfo, "leak here!"); mScriptableInfo = si;}
 
     void JSProtoObjectFinalized(JSContext *cx, JSObject *obj);
 
@@ -2570,20 +2563,16 @@ public:
     GetSecurityInfoAddr() {return HasProto() ?
                                    GetProto()->GetSecurityInfoAddr() : nsnull;}
 
     nsIClassInfo*
     GetClassInfo() const {return IsValid() && HasProto() ?
                             GetProto()->GetClassInfo() : nsnull;}
 
     JSBool
-    HasSharedProto() const {return IsValid() && HasProto() &&
-                            GetProto()->IsShared();}
-
-    JSBool
     HasMutatedSet() const {return IsValid() &&
                                   (!HasProto() ||
                                    GetSet() != GetProto()->GetSet());}
 
     XPCJSRuntime*
     GetRuntime() const {XPCWrappedNativeScope* scope = GetScope();
                         return scope ? scope->GetRuntime() : nsnull;}