v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit > Class Template Reference

#include <small-map.h>

Inheritance diagram for v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >:
Collaboration diagram for v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >:

Classes

class  const_iterator
 
class  iterator
 

Public Types

typedef NormalMap::key_type key_type
 
typedef NormalMap::mapped_type data_type
 
typedef NormalMap::mapped_type mapped_type
 
typedef NormalMap::value_type value_type
 
typedef EqualKey key_equal
 

Public Member Functions

 SmallMap ()
 
 SmallMap (const MapInit &functor)
 
 SmallMap (const SmallMap &src) V8_NOEXCEPT
 
void operator= (const SmallMap &src) V8_NOEXCEPT
 
 ~SmallMap ()
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
data_typeoperator[] (const key_type &key)
 
std::pair< iterator, bool > insert (const value_type &x)
 
template<class InputIterator >
void insert (InputIterator f, InputIterator l)
 
template<typename... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
template<typename... Args>
std::pair< iterator, bool > try_emplace (const key_type &key, Args &&... args)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void clear ()
 
iterator erase (const iterator &position)
 
size_t erase (const key_type &key)
 
size_t count (const key_type &key) const
 
size_t size () const
 
bool empty () const
 
bool UsingFullMap () const
 
V8_INLINE NormalMap * map ()
 
V8_INLINE const NormalMap * map () const
 

Private Member Functions

V8_NOINLINE V8_PRESERVE_MOST void ConvertToRealMap ()
 
void InitFrom (const SmallMap &src)
 
void Destroy ()
 

Private Attributes

size_t size_
 
MapInit functor_
 
union { 
 
   value_type   array_ [kArraySize] 
 
   NormalMap   map_ 
 
};  
 

Static Private Attributes

static constexpr size_t kUsingFullMapSentinel
 

Detailed Description

template<typename NormalMap, size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
class v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >

Definition at line 141 of file small-map.h.

Member Typedef Documentation

◆ data_type

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
NormalMap::mapped_type v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::data_type

Definition at line 151 of file small-map.h.

◆ key_equal

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
EqualKey v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::key_equal

Definition at line 154 of file small-map.h.

◆ key_type

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
NormalMap::key_type v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::key_type

Definition at line 150 of file small-map.h.

◆ mapped_type

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
NormalMap::mapped_type v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::mapped_type

Definition at line 152 of file small-map.h.

◆ value_type

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
NormalMap::value_type v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::value_type

Definition at line 153 of file small-map.h.

Constructor & Destructor Documentation

◆ SmallMap() [1/3]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::SmallMap ( )
inline

Definition at line 156 of file small-map.h.

◆ SmallMap() [2/3]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::SmallMap ( const MapInit & functor)
inlineexplicit

Definition at line 158 of file small-map.h.

◆ SmallMap() [3/3]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::SmallMap ( const SmallMap< NormalMap, kArraySize, EqualKey, MapInit > & src)
inline

Definition at line 161 of file small-map.h.

Here is the call graph for this function:

◆ ~SmallMap()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::~SmallMap ( )
inline

Definition at line 177 of file small-map.h.

Here is the call graph for this function:

Member Function Documentation

◆ begin() [1/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::begin ( )
inline

Definition at line 479 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [2/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
const_iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::begin ( ) const
inline

Definition at line 483 of file small-map.h.

Here is the call graph for this function:

◆ clear()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
void v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::clear ( )
inline

Definition at line 497 of file small-map.h.

Here is the call graph for this function:

◆ ConvertToRealMap()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
V8_NOINLINE V8_PRESERVE_MOST void v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::ConvertToRealMap ( )
inlineprivate

Definition at line 575 of file small-map.h.

Here is the caller graph for this function:

◆ count()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
size_t v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::count ( const key_type & key) const
inline

Definition at line 537 of file small-map.h.

Here is the call graph for this function:

◆ Destroy()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
void v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::Destroy ( )
inlineprivate

Definition at line 616 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
template<typename... Args>
std::pair< iterator, bool > v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::emplace ( Args &&... args)
inline

Definition at line 422 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ empty()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
bool v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::empty ( ) const
inline

Definition at line 543 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [1/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::end ( )
inline

Definition at line 488 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [2/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
const_iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::end ( ) const
inline

Definition at line 492 of file small-map.h.

Here is the call graph for this function:

◆ erase() [1/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::erase ( const iterator & position)
inline

Definition at line 509 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ erase() [2/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
size_t v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::erase ( const key_type & key)
inline

Definition at line 528 of file small-map.h.

Here is the call graph for this function:

◆ find() [1/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::find ( const key_type & key)
inline

Definition at line 329 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find() [2/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
const_iterator v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::find ( const key_type & key) const
inline

Definition at line 344 of file small-map.h.

Here is the call graph for this function:

◆ InitFrom()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
void v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::InitFrom ( const SmallMap< NormalMap, kArraySize, EqualKey, MapInit > & src)
inlineprivate

Definition at line 603 of file small-map.h.

Here is the caller graph for this function:

◆ insert() [1/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
std::pair< iterator, bool > v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::insert ( const value_type & x)
inline

Definition at line 386 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [2/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
template<class InputIterator >
void v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::insert ( InputIterator f,
InputIterator l )
inline

Definition at line 413 of file small-map.h.

Here is the call graph for this function:

◆ map() [1/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
V8_INLINE NormalMap * v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::map ( )
inline

Definition at line 549 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ map() [2/2]

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
V8_INLINE const NormalMap * v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::map ( ) const
inline

Definition at line 554 of file small-map.h.

Here is the call graph for this function:

◆ operator=()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
void v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::operator= ( const SmallMap< NormalMap, kArraySize, EqualKey, MapInit > & src)
inline

Definition at line 166 of file small-map.h.

Here is the call graph for this function:

◆ operator[]()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
data_type & v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::operator[] ( const key_type & key)
inline

Definition at line 360 of file small-map.h.

Here is the call graph for this function:

◆ size()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
size_t v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::size ( ) const
inline

Definition at line 541 of file small-map.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ try_emplace()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
template<typename... Args>
std::pair< iterator, bool > v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::try_emplace ( const key_type & key,
Args &&... args )
inline

Definition at line 452 of file small-map.h.

Here is the call graph for this function:

◆ UsingFullMap()

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
bool v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::UsingFullMap ( ) const
inline

Definition at line 547 of file small-map.h.

Here is the caller graph for this function:

Member Data Documentation

◆ [union]

union { ... } v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >

◆ array_

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
value_type v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::array_[kArraySize]

Definition at line 571 of file small-map.h.

◆ functor_

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
MapInit v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::functor_
private

Definition at line 565 of file small-map.h.

◆ kUsingFullMapSentinel

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
size_t v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::kUsingFullMapSentinel
staticconstexprprivate
Initial value:
=
std::numeric_limits<size_t>::max()

Definition at line 142 of file small-map.h.

◆ map_

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
NormalMap v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::map_

Definition at line 572 of file small-map.h.

◆ size_

template<typename NormalMap , size_t kArraySize = 4, typename EqualKey = typename internal::select_equal_key< NormalMap, internal::has_key_equal<NormalMap>::value>::equal_key, typename MapInit = internal::SmallMapDefaultInit<NormalMap>>
size_t v8::base::SmallMap< NormalMap, kArraySize, EqualKey, MapInit >::size_
private

Definition at line 563 of file small-map.h.


The documentation for this class was generated from the following file: