V8 Project
v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait > Struct Template Reference

#include <lazy-instance.h>

+ Collaboration diagram for v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >:

Public Types

typedef AllocationTrait::StorageType StorageType
 

Public Member Functions

TPointer ()
 
const TGet () const
 

Public Attributes

OnceType once_
 
StorageType storage_
 

Private Member Functions

void Init () const
 

Static Private Member Functions

static void InitInstance (StorageType *storage)
 

Detailed Description

template<typename T, typename AllocationTrait, typename CreateTrait, typename InitOnceTrait, typename DestroyTrait>
struct v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >

Definition at line 168 of file lazy-instance.h.

Member Typedef Documentation

◆ StorageType

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
typedef AllocationTrait::StorageType v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::StorageType

Definition at line 170 of file lazy-instance.h.

Member Function Documentation

◆ Get()

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
const T& v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Get ( ) const
inline

Definition at line 192 of file lazy-instance.h.

192  {
193  Init();
194  return *AllocationTrait::MutableInstance(&storage_);
195  }

References v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Init(), and v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::storage_.

Referenced by v8::internal::FINAL< kOperandKind, kNumCachedOperands >::GetCurrent(), and v8::internal::FINAL< kOperandKind, kNumCachedOperands >::SetCurrent().

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

◆ Init()

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
void v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Init ( ) const
inlineprivate

Definition at line 177 of file lazy-instance.h.

177  {
178  InitOnceTrait::Init(
179  &once_,
180  // Casts to void* are needed here to avoid breaking strict aliasing
181  // rules.
182  reinterpret_cast<void(*)(void*)>(&InitInstance), // NOLINT
183  reinterpret_cast<void*>(&storage_));
184  }
static void InitInstance(StorageType *storage)

References v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::InitInstance(), v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::once_, and v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::storage_.

Referenced by v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Get(), and v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Pointer().

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

◆ InitInstance()

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
static void v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::InitInstance ( StorageType storage)
inlinestaticprivate

Definition at line 173 of file lazy-instance.h.

173  {
174  AllocationTrait::template InitStorageUsingTrait<CreateTrait>(storage);
175  }

Referenced by v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Init().

+ Here is the caller graph for this function:

◆ Pointer()

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
T* v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Pointer ( )
inline

Definition at line 187 of file lazy-instance.h.

187  {
188  Init();
189  return AllocationTrait::MutableInstance(&storage_);
190  }

References v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::Init(), and v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::storage_.

Referenced by v8::internal::Heap::CheckpointObjectStats(), v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread(), v8::internal::Isolate::FindPerThreadDataForThread(), v8::internal::Isolate::InitializeOncePerProcess(), v8::internal::Isolate::Isolate(), v8::internal::Isolate::TearDown(), and v8::base::TEST().

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

Member Data Documentation

◆ once_

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
OnceType v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::once_
mutable

◆ storage_

template<typename T , typename AllocationTrait , typename CreateTrait , typename InitOnceTrait , typename DestroyTrait >
StorageType v8::base::LazyInstanceImpl< T, AllocationTrait, CreateTrait, InitOnceTrait, DestroyTrait >::storage_
mutable

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