Loading js/src/gc/Barrier.h +10 −6 Original line number Diff line number Diff line Loading @@ -933,10 +933,10 @@ struct MovableCellHasher<WeakHeapPtr<T>> { static void rekey(Key& k, const Key& newKey) { k.unsafeSet(newKey); } }; /* Useful for hashtables with a GCPtr as key. */ /* Useful for hashtables with a HeapPtr as key. */ template <class T> struct GCPtrHasher { typedef GCPtr<T> Key; struct HeapPtrHasher { typedef HeapPtr<T> Key; typedef T Lookup; static HashNumber hash(Lookup obj) { return DefaultHasher<T>::hash(obj); } Loading Loading @@ -986,14 +986,18 @@ class MOZ_STACK_CLASS StackGCCellPtr { namespace mozilla { /* Specialized hashing policy for GCPtrs. */ template <class T> struct DefaultHasher<js::GCPtr<T>> : js::GCPtrHasher<T> {}; struct DefaultHasher<js::HeapPtr<T>> : js::HeapPtrHasher<T> {}; template <class T> struct DefaultHasher<js::GCPtr<T>> { // Not implemented. GCPtr can't be used as a hash table key because it has a // post barrier but doesn't support relocation. }; template <class T> struct DefaultHasher<js::PreBarriered<T>> : js::PreBarrieredHasher<T> {}; /* Specialized hashing policy for WeakHeapPtrs. */ template <class T> struct DefaultHasher<js::WeakHeapPtr<T>> : js::WeakHeapPtrHasher<T> {}; Loading Loading
js/src/gc/Barrier.h +10 −6 Original line number Diff line number Diff line Loading @@ -933,10 +933,10 @@ struct MovableCellHasher<WeakHeapPtr<T>> { static void rekey(Key& k, const Key& newKey) { k.unsafeSet(newKey); } }; /* Useful for hashtables with a GCPtr as key. */ /* Useful for hashtables with a HeapPtr as key. */ template <class T> struct GCPtrHasher { typedef GCPtr<T> Key; struct HeapPtrHasher { typedef HeapPtr<T> Key; typedef T Lookup; static HashNumber hash(Lookup obj) { return DefaultHasher<T>::hash(obj); } Loading Loading @@ -986,14 +986,18 @@ class MOZ_STACK_CLASS StackGCCellPtr { namespace mozilla { /* Specialized hashing policy for GCPtrs. */ template <class T> struct DefaultHasher<js::GCPtr<T>> : js::GCPtrHasher<T> {}; struct DefaultHasher<js::HeapPtr<T>> : js::HeapPtrHasher<T> {}; template <class T> struct DefaultHasher<js::GCPtr<T>> { // Not implemented. GCPtr can't be used as a hash table key because it has a // post barrier but doesn't support relocation. }; template <class T> struct DefaultHasher<js::PreBarriered<T>> : js::PreBarrieredHasher<T> {}; /* Specialized hashing policy for WeakHeapPtrs. */ template <class T> struct DefaultHasher<js::WeakHeapPtr<T>> : js::WeakHeapPtrHasher<T> {}; Loading