v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy > Class Template Reference

#include <cross-thread-persistent.h>

Inheritance diagram for cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >:
Collaboration diagram for cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >:

Classes

class  UnsafeCtorTag
 

Public Types

using PointeeType = T
 

Public Member Functions

 ~BasicCrossThreadPersistent ()
 
 BasicCrossThreadPersistent (const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (std::nullptr_t, const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (SentinelPointer s, const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (T *raw, const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (UnsafeCtorTag, T *raw, const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (T &raw, const SourceLocation &loc=SourceLocation::Current())
 
template<typename U , typename MemberBarrierPolicy , typename MemberWeaknessTag , typename MemberCheckingPolicy , typename MemberStorageType , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
 BasicCrossThreadPersistent (internal::BasicMember< U, MemberBarrierPolicy, MemberWeaknessTag, MemberCheckingPolicy, MemberStorageType > member, const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (const BasicCrossThreadPersistent &other, const SourceLocation &loc=SourceLocation::Current())
 
template<typename U , typename OtherWeaknessPolicy , typename OtherLocationPolicy , typename OtherCheckingPolicy , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
 BasicCrossThreadPersistent (const BasicCrossThreadPersistent< U, OtherWeaknessPolicy, OtherLocationPolicy, OtherCheckingPolicy > &other, const SourceLocation &loc=SourceLocation::Current())
 
 BasicCrossThreadPersistent (BasicCrossThreadPersistent &&other, const SourceLocation &loc=SourceLocation::Current()) noexcept
 
BasicCrossThreadPersistentoperator= (const BasicCrossThreadPersistent &other)
 
template<typename U , typename OtherWeaknessPolicy , typename OtherLocationPolicy , typename OtherCheckingPolicy , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicCrossThreadPersistentoperator= (const BasicCrossThreadPersistent< U, OtherWeaknessPolicy, OtherLocationPolicy, OtherCheckingPolicy > &other)
 
BasicCrossThreadPersistentoperator= (BasicCrossThreadPersistent &&other)
 
BasicCrossThreadPersistentoperator= (T *other)
 
template<typename U , typename MemberBarrierPolicy , typename MemberWeaknessTag , typename MemberCheckingPolicy , typename MemberStorageType , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicCrossThreadPersistentoperator= (internal::BasicMember< U, MemberBarrierPolicy, MemberWeaknessTag, MemberCheckingPolicy, MemberStorageType > member)
 
BasicCrossThreadPersistentoperator= (std::nullptr_t)
 
BasicCrossThreadPersistentoperator= (SentinelPointer s)
 
 V8_CLANG_NO_SANITIZE ("cfi-unrelated-cast") T *Get() const
 
void Clear ()
 
TRelease ()
 
 operator bool () const
 
 operator T* () const
 
Toperator-> () const
 
Toperator* () const
 
template<typename U , typename OtherWeaknessPolicy = WeaknessPolicy, typename OtherLocationPolicy = LocationPolicy, typename OtherCheckingPolicy = CheckingPolicy>
BasicCrossThreadPersistent< U, OtherWeaknessPolicy, OtherLocationPolicy, OtherCheckingPolicy > To () const
 
template<typename U = T, typename = typename std::enable_if<!BasicCrossThreadPersistent< U, WeaknessPolicy>::IsStrongPersistent::value>::type>
BasicCrossThreadPersistent< U, internal::StrongCrossThreadPersistentPolicyLock () const
 
- Public Member Functions inherited from cppgc::internal::CrossThreadPersistentBase
 CrossThreadPersistentBase ()=default
 
 CrossThreadPersistentBase (const void *raw)
 
 V8_CLANG_NO_SANITIZE ("address") const void *GetValueFromGC() const
 
PersistentNodeGetNodeFromGC () const
 
void ClearFromGC () const
 
PersistentNodeGetNodeSafe () const
 
void SetNodeSafe (PersistentNode *value) const
 

Private Member Functions

void AssignUnsafe (T *ptr)
 
void AssignSafe (PersistentRegionLock &, T *ptr)
 
void ClearFromGC () const
 
TGetFromGC () const
 

Static Private Member Functions

static bool IsValid (const void *ptr)
 
static void TraceAsRoot (RootVisitor &root_visitor, const void *ptr)
 

Friends

class internal::RootVisitor
 

Additional Inherited Members

- Protected Member Functions inherited from cppgc::internal::PersistentBase
 PersistentBase ()=default
 
 PersistentBase (const void *raw)
 
const void * GetValue () const
 
void SetValue (const void *value)
 
PersistentNodeGetNode () const
 
void SetNode (PersistentNode *node)
 
void ClearFromGC () const
 
- Protected Attributes inherited from cppgc::internal::PersistentBase
const void * raw_ = nullptr
 
PersistentNodenode_ = nullptr
 

Detailed Description

template<typename T, typename WeaknessPolicy, typename LocationPolicy, typename CheckingPolicy>
class cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >

Definition at line 28 of file visitor.h.

Member Typedef Documentation

◆ PointeeType

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
using cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::PointeeType = T

Definition at line 77 of file cross-thread-persistent.h.

Constructor & Destructor Documentation

◆ ~BasicCrossThreadPersistent()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::~BasicCrossThreadPersistent ( )
inline

Definition at line 79 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ BasicCrossThreadPersistent() [1/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( const SourceLocation & loc = SourceLocation::Current())
inline

Definition at line 105 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [2/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( std::nullptr_t ,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 109 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [3/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( SentinelPointer s,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 113 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [4/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( T * raw,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 117 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ BasicCrossThreadPersistent() [5/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( UnsafeCtorTag ,
T * raw,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 135 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ BasicCrossThreadPersistent() [6/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( T & raw,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 145 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [7/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
template<typename U , typename MemberBarrierPolicy , typename MemberWeaknessTag , typename MemberCheckingPolicy , typename MemberStorageType , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( internal::BasicMember< U, MemberBarrierPolicy, MemberWeaknessTag, MemberCheckingPolicy, MemberStorageType > member,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 153 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [8/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( const BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy > & other,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 160 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [9/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
template<typename U , typename OtherWeaknessPolicy , typename OtherLocationPolicy , typename OtherCheckingPolicy , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( const BasicCrossThreadPersistent< U, OtherWeaknessPolicy, OtherLocationPolicy, OtherCheckingPolicy > & other,
const SourceLocation & loc = SourceLocation::Current() )
inline

Definition at line 172 of file cross-thread-persistent.h.

◆ BasicCrossThreadPersistent() [10/10]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::BasicCrossThreadPersistent ( BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy > && other,
const SourceLocation & loc = SourceLocation::Current() )
inlinenoexcept

Definition at line 181 of file cross-thread-persistent.h.

Member Function Documentation

◆ AssignSafe()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
void cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::AssignSafe ( PersistentRegionLock & ,
T * ptr )
inlineprivate

Definition at line 386 of file cross-thread-persistent.h.

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

◆ AssignUnsafe()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
void cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::AssignUnsafe ( T * ptr)
inlineprivate

Definition at line 358 of file cross-thread-persistent.h.

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

◆ Clear()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
void cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::Clear ( )
inline

Clears the stored object.

Definition at line 281 of file cross-thread-persistent.h.

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

◆ ClearFromGC()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
void cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::ClearFromGC ( ) const
inlineprivate

Definition at line 406 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ GetFromGC()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
T * cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::GetFromGC ( ) const
inlineprivate

Definition at line 416 of file cross-thread-persistent.h.

◆ IsValid()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
static bool cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::IsValid ( const void * ptr)
inlinestaticprivate

Definition at line 350 of file cross-thread-persistent.h.

Here is the caller graph for this function:

◆ Lock()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
template<typename U = T, typename = typename std::enable_if<!BasicCrossThreadPersistent< U, WeaknessPolicy>::IsStrongPersistent::value>::type>
BasicCrossThreadPersistent< U, internal::StrongCrossThreadPersistentPolicy > cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::Lock ( ) const
inline

Definition at line 344 of file cross-thread-persistent.h.

◆ operator bool()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator bool ( ) const
inlineexplicit

Conversio to boolean.

Note: Not thread-safe.

Returns
true if an actual object has been stored and false otherwise.

Definition at line 306 of file cross-thread-persistent.h.

◆ operator T*()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator T* ( ) const
inline

Conversion to object of type T.

Note: Not thread-safe.

Returns
the object.

Definition at line 315 of file cross-thread-persistent.h.

◆ operator*()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
T & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator* ( ) const
inline

Definition at line 323 of file cross-thread-persistent.h.

◆ operator->()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
T * cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator-> ( ) const
inline

Dereferences the stored object.

Note: Not thread-safe.

Definition at line 322 of file cross-thread-persistent.h.

◆ operator=() [1/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy > && other)
inline

Definition at line 207 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ operator=() [2/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( const BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy > & other)
inline

Definition at line 188 of file cross-thread-persistent.h.

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

◆ operator=() [3/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
template<typename U , typename OtherWeaknessPolicy , typename OtherLocationPolicy , typename OtherCheckingPolicy , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( const BasicCrossThreadPersistent< U, OtherWeaknessPolicy, OtherLocationPolicy, OtherCheckingPolicy > & other)
inline

Definition at line 198 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ operator=() [4/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
template<typename U , typename MemberBarrierPolicy , typename MemberWeaknessTag , typename MemberCheckingPolicy , typename MemberStorageType , typename = std::enable_if_t<std::is_base_of<T, U>::value>>
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( internal::BasicMember< U, MemberBarrierPolicy, MemberWeaknessTag, MemberCheckingPolicy, MemberStorageType > member)
inline

Definition at line 236 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ operator=() [5/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( SentinelPointer s)
inline

Assigns the sentinel pointer.

Returns
the handle.

Definition at line 258 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ operator=() [6/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( std::nullptr_t )
inline

Assigns a nullptr.

Returns
the handle.

Definition at line 248 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ operator=() [7/7]

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
BasicCrossThreadPersistent & cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::operator= ( T * other)
inline

Assigns a raw pointer.

Note: Not thread-safe.

Definition at line 226 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ Release()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
T * cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::Release ( )
inline

Returns a pointer to the stored object and releases it.

Note: Not thread-safe.

Returns
a pointer to the stored object.

Definition at line 293 of file cross-thread-persistent.h.

Here is the call graph for this function:

◆ To()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
template<typename U , typename OtherWeaknessPolicy = WeaknessPolicy, typename OtherLocationPolicy = LocationPolicy, typename OtherCheckingPolicy = CheckingPolicy>
BasicCrossThreadPersistent< U, OtherWeaknessPolicy, OtherLocationPolicy, OtherCheckingPolicy > cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::To ( ) const
inline

Definition at line 330 of file cross-thread-persistent.h.

◆ TraceAsRoot()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
static void cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::TraceAsRoot ( RootVisitor & root_visitor,
const void * ptr )
inlinestaticprivate

Definition at line 354 of file cross-thread-persistent.h.

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

◆ V8_CLANG_NO_SANITIZE()

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
cppgc::internal::BasicCrossThreadPersistent< T, WeaknessPolicy, LocationPolicy, CheckingPolicy >::V8_CLANG_NO_SANITIZE ( "cfi-unrelated-cast" ) const
inline

Returns a pointer to the stored object.

Note: Not thread-safe.

Returns
a pointer to the stored object.

Definition at line 274 of file cross-thread-persistent.h.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ internal::RootVisitor

template<typename T , typename WeaknessPolicy , typename LocationPolicy , typename CheckingPolicy >
friend class internal::RootVisitor
friend

Definition at line 420 of file cross-thread-persistent.h.


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