diff --git a/js/src/frontend/BinASTTokenReaderContext.cpp b/js/src/frontend/BinASTTokenReaderContext.cpp index 7ca341c2598e..437fd827e8af 100644 --- a/js/src/frontend/BinASTTokenReaderContext.cpp +++ b/js/src/frontend/BinASTTokenReaderContext.cpp @@ -1602,22 +1602,6 @@ HuffmanKey::HuffmanKey(const uint32_t bits, const uint8_t bitLength) MOZ_ASSERT_IF(bitLength_ != 32 /* >> 32 is UB */, bits >> bitLength == 0); } -FlatHuffmanKey::FlatHuffmanKey(HuffmanKey key) - : representation_((key.bitLength_ << MAX_CODE_BIT_LENGTH) | key.bits_) { - static_assert(MAX_CODE_BIT_LENGTH + MAX_BIT_LENGTH_BIT_LENGTH <= 32, - "32 bits MUST be sufficient to store bits and bitLength"); - MOZ_ASSERT(key.bits_ >> MAX_CODE_BIT_LENGTH == 0); - MOZ_ASSERT(key.bitLength_ >> MAX_BIT_LENGTH_BIT_LENGTH == 0); -} - -FlatHuffmanKey::FlatHuffmanKey(const HuffmanKey* key) - : representation_((key->bitLength_ << MAX_CODE_BIT_LENGTH) | key->bits_) { - static_assert(MAX_CODE_BIT_LENGTH + MAX_BIT_LENGTH_BIT_LENGTH <= 32, - "32 bits MUST be sufficient to store bits and bitLength"); - MOZ_ASSERT(key->bits_ >> MAX_CODE_BIT_LENGTH == 0); - MOZ_ASSERT(key->bitLength_ >> MAX_BIT_LENGTH_BIT_LENGTH == 0); -} - // ---- Implementation of Huffman Tables template diff --git a/js/src/frontend/BinASTTokenReaderContext.h b/js/src/frontend/BinASTTokenReaderContext.h index f6b8548ea129..b5f99b72b7f1 100644 --- a/js/src/frontend/BinASTTokenReaderContext.h +++ b/js/src/frontend/BinASTTokenReaderContext.h @@ -156,33 +156,6 @@ struct HuffmanKey { const uint8_t bitLength_; }; -// A Huffman key represented as a single `uint32_t`. -struct FlatHuffmanKey { - explicit FlatHuffmanKey(HuffmanKey key); - explicit FlatHuffmanKey(const HuffmanKey* key); - - // 0b0000000L_LLLLCCCC_CCCCCCCC_CCCCCCCC - // Where: - // - `LLLLL` store `key.bitLength_` - // - `CCCC_CCCCCCCC_CCCCCCCC` store `key.bits_` - // - // While `key.bits_` is nominally 32 bits, it is in fact - // `MAX_CODE_BIT_LENGTH` bits, padded with 0s in the - // highest bits. - const uint32_t representation_; - - // -- Implementing HashPolicy - using Lookup = FlatHuffmanKey; - using Key = Lookup; - static HashNumber hash(const Lookup& lookup) { - return mozilla::DefaultHasher::hash(lookup.representation_); - } - static bool match(const Key& key, const Lookup& lookup) { - return mozilla::DefaultHasher::match(key.representation_, - lookup.representation_); - } -}; - // An entry in a Huffman table. template struct HuffmanEntry { @@ -1229,12 +1202,6 @@ class MOZ_STACK_CLASS BinASTTokenReaderContext : public BinASTTokenReaderBase { uint32_t& len); private: - // A mapping string index => BinASTVariant as extracted from the [STRINGS] - // section of the file. Populated lazily. - js::HashMap, - SystemAllocPolicy> - variantsTable_; - enum class MetadataOwnership { Owned, Unowned }; MetadataOwnership metadataOwned_ = MetadataOwnership::Owned; BinASTSourceMetadata* metadata_;