V8 Project
v8::internal::SmartPointerBase< Deallocator, T > Class Template Reference

#include <smart-pointers.h>

+ Inheritance diagram for v8::internal::SmartPointerBase< Deallocator, T >:
+ Collaboration diagram for v8::internal::SmartPointerBase< Deallocator, T >:

Public Member Functions

 SmartPointerBase ()
 
 SmartPointerBase (T *ptr)
 
 SmartPointerBase (const SmartPointerBase< Deallocator, T > &rhs)
 
Toperator-> () const
 
Toperator* () const
 
Tget () const
 
Toperator[] (size_t i)
 
const Toperator[] (size_t i) const
 
TDetach ()
 
void Reset (T *new_value)
 
SmartPointerBase< Deallocator, T > & operator= (const SmartPointerBase< Deallocator, T > &rhs)
 
bool is_empty () const
 

Protected Member Functions

 ~SmartPointerBase ()
 

Private Attributes

Tp_
 

Detailed Description

template<typename Deallocator, typename T>
class v8::internal::SmartPointerBase< Deallocator, T >

Definition at line 13 of file smart-pointers.h.

Constructor & Destructor Documentation

◆ SmartPointerBase() [1/3]

template<typename Deallocator , typename T >
v8::internal::SmartPointerBase< Deallocator, T >::SmartPointerBase ( )
inline

Definition at line 16 of file smart-pointers.h.

16 : p_(NULL) {}
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

◆ SmartPointerBase() [2/3]

template<typename Deallocator , typename T >
v8::internal::SmartPointerBase< Deallocator, T >::SmartPointerBase ( T ptr)
inlineexplicit

Definition at line 19 of file smart-pointers.h.

19 : p_(ptr) {}

◆ SmartPointerBase() [3/3]

template<typename Deallocator , typename T >
v8::internal::SmartPointerBase< Deallocator, T >::SmartPointerBase ( const SmartPointerBase< Deallocator, T > &  rhs)
inline

Definition at line 23 of file smart-pointers.h.

24  : p_(rhs.p_) {
25  const_cast<SmartPointerBase<Deallocator, T>&>(rhs).p_ = NULL;
26  }

References NULL, and v8::internal::SmartPointerBase< Deallocator, T >::p_.

◆ ~SmartPointerBase()

template<typename Deallocator , typename T >
v8::internal::SmartPointerBase< Deallocator, T >::~SmartPointerBase ( )
inlineprotected

Definition at line 82 of file smart-pointers.h.

82 { if (p_) Deallocator::Delete(p_); }

References v8::internal::SmartPointerBase< Deallocator, T >::p_.

Member Function Documentation

◆ Detach()

template<typename Deallocator , typename T >
T* v8::internal::SmartPointerBase< Deallocator, T >::Detach ( )
inline

Definition at line 52 of file smart-pointers.h.

52  {
53  T* temp = p_;
54  p_ = NULL;
55  return temp;
56  }
#define T(name, string, precedence)
Definition: token.cc:25

References NULL, v8::internal::SmartPointerBase< Deallocator, T >::p_, and T.

Referenced by v8::internal::StringsStorage::GetName(), and v8::internal::Compiler::GetOptimizedCode().

+ Here is the caller graph for this function:

◆ get()

◆ is_empty()

template<typename Deallocator , typename T >
bool v8::internal::SmartPointerBase< Deallocator, T >::is_empty ( ) const
inline

Definition at line 76 of file smart-pointers.h.

76 { return p_ == NULL; }

References NULL, and v8::internal::SmartPointerBase< Deallocator, T >::p_.

Referenced by v8::internal::SmartPointerBase< Deallocator, T >::operator=().

+ Here is the caller graph for this function:

◆ operator*()

template<typename Deallocator , typename T >
T& v8::internal::SmartPointerBase< Deallocator, T >::operator* ( ) const
inline

Definition at line 30 of file smart-pointers.h.

30 { return *p_; }

References v8::internal::SmartPointerBase< Deallocator, T >::p_.

◆ operator->()

template<typename Deallocator , typename T >
T* v8::internal::SmartPointerBase< Deallocator, T >::operator-> ( ) const
inline

Definition at line 28 of file smart-pointers.h.

28 { return p_; }

References v8::internal::SmartPointerBase< Deallocator, T >::p_.

◆ operator=()

template<typename Deallocator , typename T >
SmartPointerBase<Deallocator, T>& v8::internal::SmartPointerBase< Deallocator, T >::operator= ( const SmartPointerBase< Deallocator, T > &  rhs)
inline

Definition at line 67 of file smart-pointers.h.

68  {
69  DCHECK(is_empty());
70  T* tmp = rhs.p_; // swap to handle self-assignment
71  const_cast<SmartPointerBase<Deallocator, T>&>(rhs).p_ = NULL;
72  p_ = tmp;
73  return *this;
74  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::SmartPointerBase< Deallocator, T >::is_empty(), NULL, v8::internal::SmartPointerBase< Deallocator, T >::p_, and T.

+ Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename Deallocator , typename T >
T& v8::internal::SmartPointerBase< Deallocator, T >::operator[] ( size_t  i)
inline

Definition at line 35 of file smart-pointers.h.

35  {
36  return p_[i];
37  }

References v8::internal::SmartPointerBase< Deallocator, T >::p_.

◆ operator[]() [2/2]

template<typename Deallocator , typename T >
const T& v8::internal::SmartPointerBase< Deallocator, T >::operator[] ( size_t  i) const
inline

Definition at line 40 of file smart-pointers.h.

40  {
41  return p_[i];
42  }

References v8::internal::SmartPointerBase< Deallocator, T >::p_.

◆ Reset()

template<typename Deallocator , typename T >
void v8::internal::SmartPointerBase< Deallocator, T >::Reset ( T new_value)
inline

Definition at line 58 of file smart-pointers.h.

58  {
59  DCHECK(p_ == NULL || p_ != new_value);
60  if (p_) Deallocator::Delete(p_);
61  p_ = new_value;
62  }

References DCHECK, NULL, and v8::internal::SmartPointerBase< Deallocator, T >::p_.

Referenced by v8::internal::CodeStubGraphBuilderBase::CodeStubGraphBuilderBase().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_


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