V8 Project
v8::internal::VisitorDispatchTable< Callback > Class Template Reference

#include <objects-visiting.h>

+ Inheritance diagram for v8::internal::VisitorDispatchTable< Callback >:
+ Collaboration diagram for v8::internal::VisitorDispatchTable< Callback >:

Public Member Functions

void CopyFrom (VisitorDispatchTable *other)
 
Callback GetVisitorById (StaticVisitorBase::VisitorId id)
 
Callback GetVisitor (Map *map)
 
void Register (StaticVisitorBase::VisitorId id, Callback callback)
 
template<typename Visitor , StaticVisitorBase::VisitorId base, StaticVisitorBase::VisitorId generic, int object_size_in_words>
void RegisterSpecialization ()
 
template<typename Visitor , StaticVisitorBase::VisitorId base, StaticVisitorBase::VisitorId generic>
void RegisterSpecializations ()
 

Private Attributes

base::AtomicWord callbacks_ [StaticVisitorBase::kVisitorIdCount]
 

Detailed Description

template<typename Callback>
class v8::internal::VisitorDispatchTable< Callback >

Definition at line 132 of file objects-visiting.h.

Member Function Documentation

◆ CopyFrom()

template<typename Callback >
void v8::internal::VisitorDispatchTable< Callback >::CopyFrom ( VisitorDispatchTable< Callback > *  other)
inline

Definition at line 134 of file objects-visiting.h.

134  {
135  // We are not using memcpy to guarantee that during update
136  // every element of callbacks_ array will remain correct
137  // pointer (memcpy might be implemented as a byte copying loop).
138  for (int i = 0; i < StaticVisitorBase::kVisitorIdCount; i++) {
139  base::NoBarrier_Store(&callbacks_[i], other->callbacks_[i]);
140  }
141  }
base::AtomicWord callbacks_[StaticVisitorBase::kVisitorIdCount]
void NoBarrier_Store(volatile Atomic8 *ptr, Atomic8 value)

References v8::internal::VisitorDispatchTable< Callback >::callbacks_, v8::internal::StaticVisitorBase::kVisitorIdCount, and v8::base::NoBarrier_Store().

Referenced by v8::internal::Heap::SelectScavengingVisitorsTable().

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

◆ GetVisitor()

template<typename Callback >
Callback v8::internal::VisitorDispatchTable< Callback >::GetVisitor ( Map map)
inline

Definition at line 147 of file objects-visiting.h.

147  {
148  return reinterpret_cast<Callback>(callbacks_[map->visitor_id()]);
149  }
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 map

References v8::internal::VisitorDispatchTable< Callback >::callbacks_, and map.

Referenced by v8::internal::Heap::DoScavengeObject().

+ Here is the caller graph for this function:

◆ GetVisitorById()

template<typename Callback >
Callback v8::internal::VisitorDispatchTable< Callback >::GetVisitorById ( StaticVisitorBase::VisitorId  id)
inline

Definition at line 143 of file objects-visiting.h.

143  {
144  return reinterpret_cast<Callback>(callbacks_[id]);
145  }

References v8::internal::VisitorDispatchTable< Callback >::callbacks_.

Referenced by v8::internal::Heap::SelectScavengingVisitorsTable().

+ Here is the caller graph for this function:

◆ Register()

template<typename Callback >
void v8::internal::VisitorDispatchTable< Callback >::Register ( StaticVisitorBase::VisitorId  id,
Callback  callback 
)
inline

Definition at line 151 of file objects-visiting.h.

151  {
152  DCHECK(id < StaticVisitorBase::kVisitorIdCount); // id is unsigned.
153  callbacks_[id] = reinterpret_cast<base::AtomicWord>(callback);
154  }
#define DCHECK(condition)
Definition: logging.h:205
intptr_t AtomicWord
Definition: atomicops.h:57

References v8::internal::VisitorDispatchTable< Callback >::callbacks_, DCHECK, and v8::internal::StaticVisitorBase::kVisitorIdCount.

Referenced by v8::internal::ScavengingVisitor< marks_handling, logging_and_profiling_mode >::Initialize(), v8::internal::VisitorDispatchTable< Callback >::RegisterSpecialization(), v8::internal::VisitorDispatchTable< Callback >::RegisterSpecializations(), and v8::internal::Heap::SelectScavengingVisitorsTable().

+ Here is the caller graph for this function:

◆ RegisterSpecialization()

template<typename Callback >
template<typename Visitor , StaticVisitorBase::VisitorId base, StaticVisitorBase::VisitorId generic, int object_size_in_words>
void v8::internal::VisitorDispatchTable< Callback >::RegisterSpecialization ( )
inline

Definition at line 158 of file objects-visiting.h.

158  {
159  static const int size = object_size_in_words * kPointerSize;
161  &Visitor::template VisitSpecialized<size>);
162  }
static VisitorId GetVisitorIdForSize(VisitorId base, VisitorId generic, int object_size)
void Register(StaticVisitorBase::VisitorId id, Callback callback)
enable harmony numeric enable harmony object literal extensions Optimize object size
const int kPointerSize
Definition: globals.h:129

References v8::internal::StaticVisitorBase::GetVisitorIdForSize(), v8::internal::kPointerSize, v8::internal::VisitorDispatchTable< Callback >::Register(), and size.

+ Here is the call graph for this function:

◆ RegisterSpecializations()

template<typename Callback >
template<typename Visitor , StaticVisitorBase::VisitorId base, StaticVisitorBase::VisitorId generic>
void v8::internal::VisitorDispatchTable< Callback >::RegisterSpecializations ( )
inline

Definition at line 167 of file objects-visiting.h.

167  {
169  10);
170  RegisterSpecialization<Visitor, base, generic, 2>();
171  RegisterSpecialization<Visitor, base, generic, 3>();
172  RegisterSpecialization<Visitor, base, generic, 4>();
173  RegisterSpecialization<Visitor, base, generic, 5>();
174  RegisterSpecialization<Visitor, base, generic, 6>();
175  RegisterSpecialization<Visitor, base, generic, 7>();
176  RegisterSpecialization<Visitor, base, generic, 8>();
177  RegisterSpecialization<Visitor, base, generic, 9>();
178  Register(generic, &Visitor::Visit);
179  }
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))

References v8::internal::StaticVisitorBase::kMinObjectSizeInWords, v8::internal::VisitorDispatchTable< Callback >::Register(), and v8::internal::STATIC_ASSERT().

Referenced by v8::internal::ScavengingVisitor< marks_handling, logging_and_profiling_mode >::Initialize().

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

Member Data Documentation

◆ callbacks_


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