V8 Project
v8::internal::SamplingCircularQueue< T, Length > Class Template Reference

#include <circular-queue.h>

+ Inheritance diagram for v8::internal::SamplingCircularQueue< T, Length >:
+ Collaboration diagram for v8::internal::SamplingCircularQueue< T, Length >:

Public Member Functions

 SamplingCircularQueue ()
 
 ~SamplingCircularQueue ()
 
TStartEnqueue ()
 
void FinishEnqueue ()
 
TPeek ()
 
void Remove ()
 

Private Types

enum  { kEmpty , kFull }
 

Private Member Functions

struct V8_ALIGNED (PROCESSOR_CACHE_LINE_SIZE) Entry
 
Entry * Next (Entry *entry)
 
 V8_ALIGNED (PROCESSOR_CACHE_LINE_SIZE) Entry *enqueue_pos_
 
 V8_ALIGNED (PROCESSOR_CACHE_LINE_SIZE) Entry *dequeue_pos_
 
 DISALLOW_COPY_AND_ASSIGN (SamplingCircularQueue)
 

Private Attributes

Entry buffer_ [Length]
 

Detailed Description

template<typename T, unsigned Length>
class v8::internal::SamplingCircularQueue< T, Length >

Definition at line 22 of file circular-queue.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename T , unsigned Length>
anonymous enum
private
Enumerator
kEmpty 
kFull 

Definition at line 44 of file circular-queue.h.

44  {
45  kEmpty, // Marks clean (processed) entries.
46  kFull // Marks entries already filled by the producer but not yet
47  // completely processed by the consumer.
48  };

Constructor & Destructor Documentation

◆ SamplingCircularQueue()

template<typename T , unsigned L>
v8::internal::SamplingCircularQueue< T, L >::SamplingCircularQueue

Definition at line 14 of file circular-queue-inl.h.

15  : enqueue_pos_(buffer_),
16  dequeue_pos_(buffer_) {
17 }

◆ ~SamplingCircularQueue()

template<typename T , unsigned L>
v8::internal::SamplingCircularQueue< T, L >::~SamplingCircularQueue

Definition at line 21 of file circular-queue-inl.h.

21  {
22 }

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

template<typename T , unsigned Length>
v8::internal::SamplingCircularQueue< T, Length >::DISALLOW_COPY_AND_ASSIGN ( SamplingCircularQueue< T, Length >  )
private

◆ FinishEnqueue()

template<typename T , unsigned L>
void v8::internal::SamplingCircularQueue< T, L >::FinishEnqueue

Definition at line 53 of file circular-queue-inl.h.

53  {
54  base::Release_Store(&enqueue_pos_->marker, kFull);
55  enqueue_pos_ = Next(enqueue_pos_);
56 }
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)

References v8::base::Release_Store().

+ Here is the call graph for this function:

◆ Next()

template<typename T , unsigned L>
SamplingCircularQueue< T, L >::Entry * v8::internal::SamplingCircularQueue< T, L >::Next ( Entry *  entry)
private

Definition at line 60 of file circular-queue-inl.h.

61  {
62  Entry* next = entry + 1;
63  if (next == &buffer_[L]) return buffer_;
64  return next;
65 }

References v8::internal::L.

◆ Peek()

template<typename T , unsigned L>
T * v8::internal::SamplingCircularQueue< T, L >::Peek

Definition at line 26 of file circular-queue-inl.h.

26  {
28  if (base::Acquire_Load(&dequeue_pos_->marker) == kFull) {
29  return &dequeue_pos_->record;
30  }
31  return NULL;
32 }
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
Atomic32 Acquire_Load(volatile const Atomic32 *ptr)

References v8::base::Acquire_Load(), and v8::base::MemoryBarrier().

+ Here is the call graph for this function:

◆ Remove()

template<typename T , unsigned L>
void v8::internal::SamplingCircularQueue< T, L >::Remove

Definition at line 36 of file circular-queue-inl.h.

36  {
37  base::Release_Store(&dequeue_pos_->marker, kEmpty);
38  dequeue_pos_ = Next(dequeue_pos_);
39 }

References v8::base::Release_Store().

+ Here is the call graph for this function:

◆ StartEnqueue()

template<typename T , unsigned L>
T * v8::internal::SamplingCircularQueue< T, L >::StartEnqueue

Definition at line 43 of file circular-queue-inl.h.

43  {
45  if (base::Acquire_Load(&enqueue_pos_->marker) == kEmpty) {
46  return &enqueue_pos_->record;
47  }
48  return NULL;
49 }

References v8::base::Acquire_Load(), v8::base::MemoryBarrier(), and NULL.

+ Here is the call graph for this function:

◆ V8_ALIGNED() [1/3]

template<typename T , unsigned Length>
struct v8::internal::SamplingCircularQueue< T, Length >::V8_ALIGNED ( PROCESSOR_CACHE_LINE_SIZE  )
inlineprivate

Definition at line 40 of file circular-queue.h.

50  {
51  Entry() : marker(kEmpty) {}
52  T record;
53  base::Atomic32 marker;
54  };
int32_t Atomic32
Definition: atomicops.h:44
#define T(name, string, precedence)
Definition: token.cc:25

◆ V8_ALIGNED() [2/3]

template<typename T , unsigned Length>
v8::internal::SamplingCircularQueue< T, Length >::V8_ALIGNED ( PROCESSOR_CACHE_LINE_SIZE  )
private

◆ V8_ALIGNED() [3/3]

template<typename T , unsigned Length>
v8::internal::SamplingCircularQueue< T, Length >::V8_ALIGNED ( PROCESSOR_CACHE_LINE_SIZE  )
private

Member Data Documentation

◆ buffer_

template<typename T , unsigned Length>
Entry v8::internal::SamplingCircularQueue< T, Length >::buffer_[Length]
private

Definition at line 58 of file circular-queue.h.


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