5 #ifndef V8_STRING_HASHER_H_ 6 #define V8_STRING_HASHER_H_ 8 #include "src/globals.h" 23 template <
typename s
char>
24 static inline uint32_t HashSequentialString(
const schar* chars,
int length,
29 int* utf16_length_out);
39 static const int kZeroHash = 27;
42 V8_INLINE
static uint32_t AddCharacterCore(
uint32_t running_hash, uint16_t c);
44 template <
typename Char>
46 const Char* chars,
int length);
54 inline bool has_trivial_hash();
56 template <
typename Char>
57 inline void AddCharacters(
const Char* chars,
int len);
61 inline void AddCharacter(uint16_t c);
63 inline bool UpdateIndex(uint16_t c);
75 inline void VisitOneByteString(
const uint8_t* chars,
int length);
76 inline void VisitTwoByteString(
const uint16_t* chars,
int length);
87 inline std::size_t operator()(
const char* name)
const;
94 bool operator()(
const char* name1,
const char* name2)
const {
95 return strcmp(name1, name2) == 0;
102 #endif // V8_STRING_HASHER_H_