v8
7.4.288(node12.0.0)
V8 is Google's open source JavaScript engine
|
#include <v8-util.h>
Data Structures | |
class | PersistentValueReference |
Public Member Functions | |
Isolate * | GetIsolate () |
size_t | Size () |
bool | IsWeak () |
Local< V > | Get (const K &key) |
bool | Contains (const K &key) |
bool | SetReturnValue (const K &key, ReturnValue< Value > returnValue) |
V8_DEPRECATE_SOON ("Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference", inline void RegisterExternallyReferencedObject(K &key)) | |
Global< V > | Remove (const K &key) |
void | Clear () |
PersistentValueReference | GetReference (const K &key) |
Protected Member Functions | |
PersistentValueMapBase (Isolate *isolate) | |
PersistentValueMapBase (Isolate *isolate, const char *label) | |
~PersistentValueMapBase () | |
Isolate * | isolate () |
Traits::Impl * | impl () |
void | RemoveWeak (const K &key) |
void | AnnotateStrongRetainer (Global< V > *persistent) |
Static Protected Member Functions | |
static V * | FromVal (PersistentContainerValue v) |
static PersistentContainerValue | ClearAndLeak (Global< V > *persistent) |
static PersistentContainerValue | Leak (Global< V > *persistent) |
static Global< V > | Release (PersistentContainerValue v) |
A map wrapper that allows using Global as a mapped value. C++11 embedders don't need this class, as they can use Global directly in std containers.
The map relies on a backing map, whose type and accessors are described by the Traits class. The backing map will handle values of type PersistentContainerValue, with all conversion into and out of V8 handles being transparently handled by this class.
|
inlineexplicitprotected |
|
inlineprotected |
|
inlineprotected |
Definition at line 292 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::Clear().
Definition at line 332 of file v8-util.h.
References PersistentBase< T >::AnnotateStrongRetainer().
Referenced by PersistentValueMap< K, V, Traits >::SetUnique(), and GlobalValueMap< K, V, Traits >::SetUnique().
|
inline |
Traverses the map repeatedly, in case side effects of disposal cause insertions.
Definition at line 216 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::impl(), and PersistentValueMapBase< K, V, Traits >::Release().
Referenced by PersistentValueMapBase< K, V, Traits >::~PersistentValueMapBase().
|
inlinestaticprotected |
Definition at line 301 of file v8-util.h.
References V.
Referenced by PersistentValueMap< K, V, Traits >::SetUnique(), and GlobalValueMap< K, V, Traits >::SetUnique().
|
inline |
|
inlinestaticprotected |
Get value stored in map.
Definition at line 177 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::FromVal(), and Local< T >::New().
|
inline |
Get a reference to a map value. This enables fast, repeated access to a value stored in the map while the map remains unchanged.
Careful: This is potentially unsafe, so please use with care. The value will become invalid if the value for this key changes in the underlying map, as a result of Set or Remove for the same key; as a result of the weak callback for the same key; or as a result of calling Clear() or destruction of the map.
|
inlineprotected |
Definition at line 295 of file v8-util.h.
Referenced by PersistentValueMapBase< K, V, Traits >::Clear(), PersistentValueMap< K, V, Traits >::SetUnique(), and GlobalValueMap< K, V, Traits >::SetUnique().
|
inlineprotected |
Definition at line 294 of file v8-util.h.
Referenced by PersistentValueMapBase< K, V, Traits >::PersistentValueReference::NewLocal(), PersistentValueMap< K, V, Traits >::Set(), GlobalValueMap< K, V, Traits >::Set(), PersistentValueMap< K, V, Traits >::SetUnique(), and GlobalValueMap< K, V, Traits >::SetUnique().
|
inline |
Return whether the map holds weak persistents.
Definition at line 172 of file v8-util.h.
References v8::kNotWeak.
|
inlinestaticprotected |
Definition at line 307 of file v8-util.h.
Referenced by PersistentValueMap< K, V, Traits >::Set(), and GlobalValueMap< K, V, Traits >::Set().
|
inlinestaticprotected |
Return a container value as Global and make sure the weak callback is properly disposed of. All remove functionality should go through this.
Definition at line 316 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::FromVal(), PersistentBase< T >::IsWeak(), v8::kNotWeak, and Global< T >::Pass().
Referenced by PersistentValueMapBase< K, V, Traits >::Clear(), PersistentValueMapBase< K, V, Traits >::Remove(), PersistentValueMap< K, V, Traits >::SetUnique(), and GlobalValueMap< K, V, Traits >::SetUnique().
Return value for key and remove it from the map.
Definition at line 208 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::Release().
|
inlineprotected |
Definition at line 326 of file v8-util.h.
References PersistentValueMapBase< K, V, Traits >::FromVal(), and PersistentBase< T >::Reset().
|
inline |
V8_DEPRECATE_SOON | ( | "Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference" | , |
inline void | RegisterExternallyReferencedObjectK &key | ||
) |
Call V8::RegisterExternallyReferencedObject with the map value for given key.