Loading js/src/gc/Barrier.cpp +19 −3 Original line number Diff line number Diff line Loading @@ -67,6 +67,10 @@ bool CurrentThreadIsIonCompiling() { #endif // DEBUG static inline js::HashNumber UniqueIdToHash(uint64_t uid) { return mozilla::HashGeneric(uid); } template <typename T> /* static */ bool StableCellHasher<T>::maybeGetHash(const Lookup& l, HashNumber* hashOut) { Loading @@ -75,7 +79,13 @@ template <typename T> return true; } return l->zoneFromAnyThread()->maybeGetHashCode(l, hashOut); uint64_t uid; if (!l->zoneFromAnyThread()->maybeGetUniqueId(l, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } template <typename T> Loading @@ -86,7 +96,13 @@ template <typename T> return true; } return l->zoneFromAnyThread()->getOrCreateHashCode(l, hashOut); uint64_t uid; if (!l->zoneFromAnyThread()->getOrCreateUniqueId(l, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } template <typename T> Loading @@ -102,7 +118,7 @@ template <typename T> MOZ_ASSERT(CurrentThreadCanAccessZone(l->zoneFromAnyThread()) || CurrentThreadIsPerformingGC()); return l->zoneFromAnyThread()->getHashCodeInfallible(l); return UniqueIdToHash(l->zoneFromAnyThread()->getUniqueIdInfallible(l)); } template <typename T> Loading js/src/gc/Zone-inl.h +0 −30 Original line number Diff line number Diff line Loading @@ -11,21 +11,6 @@ #include "vm/Runtime.h" static inline js::HashNumber UniqueIdToHash(uint64_t uid) { return mozilla::HashGeneric(uid); } inline bool JS::Zone::maybeGetHashCode(js::gc::Cell* cell, js::HashNumber* hashOut) { uint64_t uid; if (!maybeGetUniqueId(cell, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } inline bool JS::Zone::maybeGetUniqueId(js::gc::Cell* cell, uint64_t* uidp) { MOZ_ASSERT(uidp); MOZ_ASSERT(js::CurrentThreadCanAccessZone(this) || Loading Loading @@ -55,17 +40,6 @@ inline bool JS::Zone::maybeGetUniqueId(js::gc::Cell* cell, uint64_t* uidp) { return true; } inline bool JS::Zone::getOrCreateHashCode(js::gc::Cell* cell, js::HashNumber* hashOut) { uint64_t uid; if (!getOrCreateUniqueId(cell, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } inline bool JS::Zone::getOrCreateUniqueId(js::gc::Cell* cell, uint64_t* uidp) { MOZ_ASSERT(uidp); MOZ_ASSERT(js::CurrentThreadCanAccessZone(this) || Loading Loading @@ -136,10 +110,6 @@ inline bool JS::Zone::setOrUpdateUniqueId(JSContext* cx, js::gc::Cell* cell, return uniqueIds().put(cell, uid); } inline js::HashNumber JS::Zone::getHashCodeInfallible(js::gc::Cell* cell) { return UniqueIdToHash(getUniqueIdInfallible(cell)); } inline uint64_t JS::Zone::getUniqueIdInfallible(js::gc::Cell* cell) { uint64_t uid; js::AutoEnterOOMUnsafeRegion oomUnsafe; Loading js/src/gc/Zone.h +0 −6 Original line number Diff line number Diff line Loading @@ -549,16 +549,10 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> { // Gets an existing UID in |uidp| if one exists. [[nodiscard]] bool maybeGetUniqueId(js::gc::Cell* cell, uint64_t* uidp); [[nodiscard]] bool maybeGetHashCode(js::gc::Cell* cell, js::HashNumber* hashOut); // Puts an existing UID in |uidp|, or creates a new UID for this Cell and // puts that into |uidp|. Returns false on OOM. [[nodiscard]] bool getOrCreateUniqueId(js::gc::Cell* cell, uint64_t* uidp); [[nodiscard]] bool getOrCreateHashCode(js::gc::Cell* cell, js::HashNumber* hashOut); js::HashNumber getHashCodeInfallible(js::gc::Cell* cell); uint64_t getUniqueIdInfallible(js::gc::Cell* cell); // Return true if this cell has a UID associated with it. Loading Loading
js/src/gc/Barrier.cpp +19 −3 Original line number Diff line number Diff line Loading @@ -67,6 +67,10 @@ bool CurrentThreadIsIonCompiling() { #endif // DEBUG static inline js::HashNumber UniqueIdToHash(uint64_t uid) { return mozilla::HashGeneric(uid); } template <typename T> /* static */ bool StableCellHasher<T>::maybeGetHash(const Lookup& l, HashNumber* hashOut) { Loading @@ -75,7 +79,13 @@ template <typename T> return true; } return l->zoneFromAnyThread()->maybeGetHashCode(l, hashOut); uint64_t uid; if (!l->zoneFromAnyThread()->maybeGetUniqueId(l, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } template <typename T> Loading @@ -86,7 +96,13 @@ template <typename T> return true; } return l->zoneFromAnyThread()->getOrCreateHashCode(l, hashOut); uint64_t uid; if (!l->zoneFromAnyThread()->getOrCreateUniqueId(l, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } template <typename T> Loading @@ -102,7 +118,7 @@ template <typename T> MOZ_ASSERT(CurrentThreadCanAccessZone(l->zoneFromAnyThread()) || CurrentThreadIsPerformingGC()); return l->zoneFromAnyThread()->getHashCodeInfallible(l); return UniqueIdToHash(l->zoneFromAnyThread()->getUniqueIdInfallible(l)); } template <typename T> Loading
js/src/gc/Zone-inl.h +0 −30 Original line number Diff line number Diff line Loading @@ -11,21 +11,6 @@ #include "vm/Runtime.h" static inline js::HashNumber UniqueIdToHash(uint64_t uid) { return mozilla::HashGeneric(uid); } inline bool JS::Zone::maybeGetHashCode(js::gc::Cell* cell, js::HashNumber* hashOut) { uint64_t uid; if (!maybeGetUniqueId(cell, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } inline bool JS::Zone::maybeGetUniqueId(js::gc::Cell* cell, uint64_t* uidp) { MOZ_ASSERT(uidp); MOZ_ASSERT(js::CurrentThreadCanAccessZone(this) || Loading Loading @@ -55,17 +40,6 @@ inline bool JS::Zone::maybeGetUniqueId(js::gc::Cell* cell, uint64_t* uidp) { return true; } inline bool JS::Zone::getOrCreateHashCode(js::gc::Cell* cell, js::HashNumber* hashOut) { uint64_t uid; if (!getOrCreateUniqueId(cell, &uid)) { return false; } *hashOut = UniqueIdToHash(uid); return true; } inline bool JS::Zone::getOrCreateUniqueId(js::gc::Cell* cell, uint64_t* uidp) { MOZ_ASSERT(uidp); MOZ_ASSERT(js::CurrentThreadCanAccessZone(this) || Loading Loading @@ -136,10 +110,6 @@ inline bool JS::Zone::setOrUpdateUniqueId(JSContext* cx, js::gc::Cell* cell, return uniqueIds().put(cell, uid); } inline js::HashNumber JS::Zone::getHashCodeInfallible(js::gc::Cell* cell) { return UniqueIdToHash(getUniqueIdInfallible(cell)); } inline uint64_t JS::Zone::getUniqueIdInfallible(js::gc::Cell* cell) { uint64_t uid; js::AutoEnterOOMUnsafeRegion oomUnsafe; Loading
js/src/gc/Zone.h +0 −6 Original line number Diff line number Diff line Loading @@ -549,16 +549,10 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> { // Gets an existing UID in |uidp| if one exists. [[nodiscard]] bool maybeGetUniqueId(js::gc::Cell* cell, uint64_t* uidp); [[nodiscard]] bool maybeGetHashCode(js::gc::Cell* cell, js::HashNumber* hashOut); // Puts an existing UID in |uidp|, or creates a new UID for this Cell and // puts that into |uidp|. Returns false on OOM. [[nodiscard]] bool getOrCreateUniqueId(js::gc::Cell* cell, uint64_t* uidp); [[nodiscard]] bool getOrCreateHashCode(js::gc::Cell* cell, js::HashNumber* hashOut); js::HashNumber getHashCodeInfallible(js::gc::Cell* cell); uint64_t getUniqueIdInfallible(js::gc::Cell* cell); // Return true if this cell has a UID associated with it. Loading