v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
hashing.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstring>
#include <functional>
#include <type_traits>
#include <utility>
#include "src/base/base-export.h"
#include "src/base/bits.h"
#include "src/base/macros.h"
Include dependency graph for hashing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  v8::base::Hasher
 
struct  v8::base::hash< T >
 
struct  v8::base::bit_equal_to< T >
 
struct  v8::base::bit_hash< T >
 
struct  std::hash< T >
 

Namespaces

namespace  v8
 
namespace  v8::base
 
namespace  std
 STL namespace.
 

Concepts

concept  v8::base::Hashable
 

Macros

#define V8_BASE_HASH_VALUE_TRIVIAL(type)
 
#define V8_BASE_HASH_VALUE_SIGNED(type)
 
#define V8_BASE_BIT_SPECIALIZE_TRIVIAL(type)
 
#define V8_BASE_BIT_SPECIALIZE_BIT_CAST(type, btype)
 

Functions

V8_INLINE size_t v8::base::hash_combine (size_t seed, size_t hash)
 
template<typename T >
V8_INLINE size_t v8::base::hash_value_unsigned_impl (T v)
 
V8_INLINE size_t v8::base::hash_value (unsigned int v)
 
V8_INLINE size_t v8::base::hash_value (unsigned long v)
 
V8_INLINE size_t v8::base::hash_value (unsigned long long v)
 
V8_INLINE size_t v8::base::hash_value (float v)
 
V8_INLINE size_t v8::base::hash_value (double v)
 
template<typename T , size_t N>
V8_INLINE size_t v8::base::hash_value (const T(&v)[N])
 
template<typename T , size_t N>
V8_INLINE size_t v8::base::hash_value (T(&v)[N])
 
template<typename T >
V8_INLINE size_t v8::base::hash_value (T *const &v)
 
template<typename T1 , typename T2 >
V8_INLINE size_t v8::base::hash_value (std::pair< T1, T2 > const &v)
 
template<typename... T, size_t... I>
V8_INLINE size_t v8::base::hash_value_impl (std::tuple< T... > const &v, std::index_sequence< I... >)
 
template<typename... T>
V8_INLINE size_t v8::base::hash_value (std::tuple< T... > const &v)
 
template<typename T >
requires std::is_enum<T>::value
V8_INLINE size_t v8::base::hash_value (T v)
 
template<typename T >
requires requires(const T& t) { { t.hash_value() } -> std::convertible_to<size_t>; }
V8_INLINE size_t v8::base::hash_value (const T &v)
 
template<typename... Ts>
V8_INLINE size_t v8::base::hash_combine (Ts const &... vs)
 
template<typename Iterator >
V8_INLINE size_t v8::base::hash_range (Iterator first, Iterator last)
 

Macro Definition Documentation

◆ V8_BASE_BIT_SPECIALIZE_BIT_CAST

#define V8_BASE_BIT_SPECIALIZE_BIT_CAST ( type,
btype )
Value:
template <> \
struct bit_equal_to<type> { \
V8_INLINE bool operator()(type lhs, type rhs) const { \
return base::bit_cast<btype>(lhs) == base::bit_cast<btype>(rhs); \
} \
}; \
template <> \
struct bit_hash<type> { \
V8_INLINE size_t operator()(type v) const { \
hash<btype> h; \
return h(base::bit_cast<btype>(v)); \
} \
};
#define V8_INLINE
Definition v8config.h:500

Definition at line 343 of file hashing.h.

◆ V8_BASE_BIT_SPECIALIZE_TRIVIAL

#define V8_BASE_BIT_SPECIALIZE_TRIVIAL ( type)
Value:
template <> \
struct bit_equal_to<type> : public std::equal_to<type> {}; \
template <> \
struct bit_hash<type> : public hash<type> {};

Definition at line 326 of file hashing.h.

◆ V8_BASE_HASH_VALUE_SIGNED

#define V8_BASE_HASH_VALUE_SIGNED ( type)
Value:
V8_INLINE size_t hash_value(signed type v) { \
return hash_value(base::bit_cast<unsigned type>(v)); \
}

Definition at line 217 of file hashing.h.

◆ V8_BASE_HASH_VALUE_TRIVIAL

#define V8_BASE_HASH_VALUE_TRIVIAL ( type)
Value:
V8_INLINE size_t hash_value(type v) { return static_cast<size_t>(v); }

Definition at line 198 of file hashing.h.