Bug 1290587, part 3 - Inline accessors in XPCNativeSetKey::Hash(). r=mrbkap draft
authorAndrew McCreight <continuation@gmail.com>
Sun, 31 Jul 2016 11:36:18 -0700
changeset 394785 045ff15d1b44eb4d4d1b2083386c3a3ed2161920
parent 394784 6f87dbf7fd6dc2fd9813deabadde7243851f0f9c
child 394786 8a768f235f306b4711579aa983ce01759b08acfc
push id24631
push userbmo:continuation@gmail.com
push dateSun, 31 Jul 2016 18:47:25 +0000
reviewersmrbkap
bugs1290587
milestone50.0a1
Bug 1290587, part 3 - Inline accessors in XPCNativeSetKey::Hash(). r=mrbkap MozReview-Commit-ID: DVp7uNo3Myn
js/xpconnect/src/XPCWrappedNativeInfo.cpp
--- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp
@@ -426,33 +426,29 @@ XPCNativeInterface::DebugDump(int16_t de
 /***************************************************************************/
 // XPCNativeSetKey
 
 PLDHashNumber
 XPCNativeSetKey::Hash() const
 {
     PLDHashNumber h = 0;
 
-    XPCNativeSet* Set = GetBaseSet();
-    XPCNativeInterface* Addition = GetAddition();
-    uint16_t Position = GetPosition();
-
-    if (!Set) {
-        MOZ_ASSERT(Addition, "bad key");
+    if (!mBaseSet) {
+        MOZ_ASSERT(mAddition, "bad key");
         // This would be an XOR like below.
         // But "0 ^ x == x". So it does not matter.
-        h = (js::HashNumber) NS_PTR_TO_INT32(Addition) >> 2;
+        h = (js::HashNumber) NS_PTR_TO_INT32(mAddition) >> 2;
     } else {
-        XPCNativeInterface** Current = Set->GetInterfaceArray();
-        uint16_t count = Set->GetInterfaceCount();
-        if (Addition) {
+        XPCNativeInterface** Current = mBaseSet->GetInterfaceArray();
+        uint16_t count = mBaseSet->GetInterfaceCount();
+        if (mAddition) {
             count++;
             for (uint16_t i = 0; i < count; i++) {
-                if (i == Position)
-                    h ^= (js::HashNumber) NS_PTR_TO_INT32(Addition) >> 2;
+                if (i == mPosition)
+                    h ^= (js::HashNumber) NS_PTR_TO_INT32(mAddition) >> 2;
                 else
                     h ^= (js::HashNumber) NS_PTR_TO_INT32(*(Current++)) >> 2;
             }
         } else {
             for (uint16_t i = 0; i < count; i++)
                 h ^= (js::HashNumber) NS_PTR_TO_INT32(*(Current++)) >> 2;
         }
     }