CodeBlockHash::CodeBlockHash(const SourceCode& sourceCode, CodeSpecializationKind kind)
    : m_hash(0)
{
    SHA1 sha1;
    sha1.addBytes(sourceCode.toUTF8());
    Vector<uint8_t, 20> digest;
    sha1.computeHash(digest);
    m_hash += digest[0] | (digest[1] << 8) | (digest[2] << 16) | (digest[3] << 24);
    m_hash ^= static_cast<unsigned>(kind);
    
    // Ensure that 0 corresponds to the hash not having been computed.
    if (!m_hash)
        m_hash = 1;
}