Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
dart::StoreBuffer Class Reference

#include <pointer_block.h>

Inheritance diagram for dart::StoreBuffer:
dart::BlockStack< kStoreBufferBlockSize >

Public Types

enum  ThresholdPolicy { kCheckThreshold , kIgnoreThreshold }
 
- Public Types inherited from dart::BlockStack< kStoreBufferBlockSize >
typedef PointerBlock< BlockSize > Block
 

Public Member Functions

void PushBlock (Block *block, ThresholdPolicy policy)
 
bool Overflowed ()
 
intptr_t Size ()
 
- Public Member Functions inherited from dart::BlockStack< kStoreBufferBlockSize >
 BlockStack ()
 
 ~BlockStack ()
 
BlockPopNonFullBlock ()
 
BlockPopEmptyBlock ()
 
BlockPopNonEmptyBlock ()
 
BlockPopAll ()
 
void PushAll (Block *blocks)
 
void Reset ()
 
bool IsEmpty ()
 
BlockWaitForWork (RelaxedAtomic< uintptr_t > *num_busy, bool abort)
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 

Static Public Attributes

static constexpr intptr_t kMaxNonEmpty = 100
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::BlockStack< kStoreBufferBlockSize >
static void Init ()
 
static void Cleanup ()
 
- Protected Member Functions inherited from dart::BlockStack< kStoreBufferBlockSize >
bool IsEmptyLocked ()
 
void PushBlockImpl (Block *block)
 
- Static Protected Member Functions inherited from dart::BlockStack< kStoreBufferBlockSize >
static void TrimGlobalEmpty ()
 
- Protected Attributes inherited from dart::BlockStack< kStoreBufferBlockSize >
List full_
 
List partial_
 
Monitor monitor_
 
- Static Protected Attributes inherited from dart::BlockStack< kStoreBufferBlockSize >
static constexpr intptr_t kMaxGlobalEmpty
 
static Listglobal_empty_
 
static Mutexglobal_mutex_
 

Detailed Description

Definition at line 264 of file pointer_block.h.

Member Enumeration Documentation

◆ ThresholdPolicy

Enumerator
kCheckThreshold 
kIgnoreThreshold 

Definition at line 269 of file pointer_block.h.

Member Function Documentation

◆ Overflowed()

bool dart::StoreBuffer::Overflowed ( )

Definition at line 240 of file pointer_block.cc.

240 {
241 MonitorLocker ml(&monitor_);
242 return (full_.length() + partial_.length()) > kMaxNonEmpty;
243}
static constexpr intptr_t kMaxNonEmpty

◆ PushBlock()

void dart::StoreBuffer::PushBlock ( Block block,
ThresholdPolicy  policy 
)

Definition at line 147 of file pointer_block.cc.

147 {
149 if ((policy == kCheckThreshold) && Overflowed()) {
150 MonitorLocker ml(&monitor_);
151 Thread* thread = Thread::Current();
152 // Sanity check: it makes no sense to schedule the GC in another isolate
153 // group.
154 // (If Isolate ever gets multiple store buffers, we should avoid this
155 // coupling by passing in an explicit callback+parameter at construction.)
156 ASSERT(thread->isolate_group()->store_buffer() == this);
157 thread->ScheduleInterrupts(Thread::kVMInterrupt);
158 }
159}
void PushBlockImpl(Block *block)
static Thread * Current()
Definition thread.h:361
#define ASSERT(E)

◆ Size()

intptr_t dart::StoreBuffer::Size ( )

Definition at line 245 of file pointer_block.cc.

245 {
246 ASSERT(Thread::Current()->OwnsGCSafepoint()); // No lock needed.
247 return full_.length() + partial_.length();
248}

Member Data Documentation

◆ kMaxNonEmpty

constexpr intptr_t dart::StoreBuffer::kMaxNonEmpty = 100
staticconstexpr

Definition at line 267 of file pointer_block.h.


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