diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 774cd9c5ffd..57c2e356b2e 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -4058,6 +4058,25 @@ GCRuntime::markAllGrayReferences(gcstats::Phase phase) #ifdef DEBUG +struct GCChunkHasher { + typedef gc::Chunk* Lookup; + + /* + * Strip zeros for better distribution after multiplying by the golden + * ratio. + */ + static HashNumber hash(gc::Chunk* chunk) { + MOZ_ASSERT(!(uintptr_t(chunk) & gc::ChunkMask)); + return HashNumber(uintptr_t(chunk) >> gc::ChunkShift); + } + + static bool match(gc::Chunk* k, gc::Chunk* l) { + MOZ_ASSERT(!(uintptr_t(k) & gc::ChunkMask)); + MOZ_ASSERT(!(uintptr_t(l) & gc::ChunkMask)); + return k == l; + } +}; + class js::gc::MarkingValidator { public: diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 6b65c48bee2..633ea403cf5 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -1100,27 +1100,6 @@ class GCParallelTask virtual void runFromHelperThread(); }; -struct GCChunkHasher { - typedef gc::Chunk* Lookup; - - /* - * Strip zeros for better distribution after multiplying by the golden - * ratio. - */ - static HashNumber hash(gc::Chunk* chunk) { - MOZ_ASSERT(!(uintptr_t(chunk) & gc::ChunkMask)); - return HashNumber(uintptr_t(chunk) >> gc::ChunkShift); - } - - static bool match(gc::Chunk* k, gc::Chunk* l) { - MOZ_ASSERT(!(uintptr_t(k) & gc::ChunkMask)); - MOZ_ASSERT(!(uintptr_t(l) & gc::ChunkMask)); - return k == l; - } -}; - -typedef HashSet GCChunkSet; - typedef void (*IterateChunkCallback)(JSRuntime* rt, void* data, gc::Chunk* chunk); typedef void (*IterateZoneCallback)(JSRuntime* rt, void* data, JS::Zone* zone); typedef void (*IterateArenaCallback)(JSRuntime* rt, void* data, gc::Arena* arena,