From 44957eec6d72249c9e6bead81da2fb8dc44bd80e Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Thu, 10 Jun 2010 12:22:15 +0200 Subject: [PATCH] Fix for bug 560462 (Use fast unwrapping for more quickstubs), part 4 - need different XPCNativeScriptableShareds for CI with different interface bitmaps. r=jst. --- js/src/xpconnect/src/xpcmaps.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/src/xpconnect/src/xpcmaps.cpp b/js/src/xpconnect/src/xpcmaps.cpp index c1140e8c9f0..6cd45c0fa6d 100644 --- a/js/src/xpconnect/src/xpcmaps.cpp +++ b/js/src/xpconnect/src/xpcmaps.cpp @@ -474,7 +474,9 @@ XPCNativeScriptableSharedMap::Entry::Hash(JSDHashTable *table, const void *key) XPCNativeScriptableShared* obj = (XPCNativeScriptableShared*) key; - // hash together the flags and the classname string + // hash together the flags and the classname string, ignore the interfaces + // bitmap since it's very rare that it's different when flags and classname + // are the same. h = (JSDHashNumber) obj->GetFlags(); for (s = (const unsigned char*) obj->GetJSClass()->name; *s != '\0'; s++) @@ -493,9 +495,10 @@ XPCNativeScriptableSharedMap::Entry::Match(JSDHashTable *table, XPCNativeScriptableShared* obj2 = (XPCNativeScriptableShared*) key; - // match the flags and the classname string + // match the flags, the classname string and the interfaces bitmap - if(obj1->GetFlags() != obj2->GetFlags()) + if(obj1->GetFlags() != obj2->GetFlags() || + obj1->GetInterfacesBitmap() != obj2->GetInterfacesBitmap()) return JS_FALSE; const char* name1 = obj1->GetJSClass()->name;