5#ifndef RUNTIME_VM_HEAP_POINTER_BLOCK_H_
6#define RUNTIME_VM_HEAP_POINTER_BLOCK_H_
17class ObjectPointerVisitor;
33 intptr_t
Count()
const {
return top_; }
39 pointers_[top_++] = obj;
44 return pointers_[--top_];
51 for (intptr_t
i = 0;
i <
Count();
i++) {
52 if (pointers_[
i] == obj) {
73 PointerBlock<Size>* next_;
75 ObjectPtr pointers_[
kSize];
79 template <
int,
typename T>
88template <
int BlockSize>
121 List() : head_(nullptr), length_(0) {}
125 intptr_t
length()
const {
return length_; }
126 bool IsEmpty()
const {
return head_ ==
nullptr; }
133 DISALLOW_COPY_AND_ASSIGN(
List);
157template <
typename Stack>
163 local_output_ = stack_->PopEmptyBlock();
164 local_input_ = stack_->PopEmptyBlock();
168 ASSERT(local_output_ ==
nullptr);
169 ASSERT(local_input_ ==
nullptr);
170 ASSERT(stack_ ==
nullptr);
176 ASSERT(local_input_ !=
nullptr);
177 if (
UNLIKELY(local_input_->IsEmpty())) {
178 if (!local_output_->IsEmpty()) {
179 auto temp = local_output_;
180 local_output_ = local_input_;
183 Block* new_work = stack_->PopNonEmptyBlock();
184 if (new_work ==
nullptr) {
187 stack_->PushBlock(local_input_);
188 local_input_ = new_work;
193 *
object = local_input_->Pop();
202 if (!first_choice->local_input_->IsEmpty()) {
203 *
object = first_choice->local_input_->Pop();
206 if (!second_choice->local_input_->IsEmpty()) {
207 *
object = second_choice->local_input_->Pop();
210 if (first_choice->
Pop(
object)) {
213 if (second_choice->
Pop(
object)) {
220 if (
UNLIKELY(local_output_->IsFull())) {
221 stack_->PushBlock(local_output_);
222 local_output_ = stack_->PopEmptyBlock();
224 local_output_->Push(raw_obj);
228 if (!local_output_->IsEmpty()) {
229 stack_->PushBlock(local_output_);
230 local_output_ = stack_->PopEmptyBlock();
232 if (!local_input_->IsEmpty()) {
233 stack_->PushBlock(local_input_);
234 local_input_ = stack_->PopEmptyBlock();
239 ASSERT(local_input_->IsEmpty() || abort);
240 Block* new_work = stack_->WaitForWork(num_busy, abort);
241 if (new_work ==
nullptr) {
244 stack_->PushBlock(local_input_);
245 local_input_ = new_work;
250 ASSERT(local_output_->IsEmpty());
251 stack_->PushBlock(local_output_);
252 local_output_ =
nullptr;
253 ASSERT(local_input_->IsEmpty());
254 stack_->PushBlock(local_input_);
255 local_input_ =
nullptr;
261 stack_->PushBlock(local_output_);
262 local_output_ =
nullptr;
263 stack_->PushBlock(local_input_);
264 local_input_ =
nullptr;
269 if (!local_input_->IsEmpty()) {
272 if (!local_output_->IsEmpty()) {
281 Block* local_output_;
331template <
int Size,
typename T>
337 template <
typename Lambda>
341 while (block !=
nullptr) {
342 while (!block->IsEmpty()) {
343 action(
static_cast<T>(block->Pop()));
345 auto*
next = block->next();
371 while (block !=
nullptr) {
372 auto*
next = block->next_;
static float next(float f)
SkBlockAllocator::Block Block
static void TrimGlobalEmpty()
Block * PopNonFullBlock()
static Mutex * global_mutex_
PointerBlock< BlockSize > Block
Block * WaitForWork(RelaxedAtomic< uintptr_t > *num_busy, bool abort)
static List * global_empty_
void PushAll(Block *blocks)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
static constexpr intptr_t kMaxGlobalEmpty
void PushBlockImpl(Block *block)
Block * PopNonEmptyBlock()
DART_FORCE_INLINE bool Pop(ObjectPtr *object)
void Push(ObjectPtr raw_obj)
static DART_FORCE_INLINE bool Pop(BlockWorkList *first_choice, BlockWorkList *second_choice, ObjectPtr *object)
BlockWorkList(Stack *stack)
bool WaitForWork(RelaxedAtomic< uintptr_t > *num_busy, bool abort=false)
DART_FORCE_INLINE void Process(Lambda action)
void PushBlock(Block *block)
static intptr_t pointers_offset()
static intptr_t top_offset()
PointerBlock< Size > * next() const
void set_next(PointerBlock< Size > *next)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void PushBlock(Block *block, ThresholdPolicy policy)
static constexpr intptr_t kMaxNonEmpty
#define MSAN_UNPOISON(ptr, len)
bool Contains(const Container &container, const Value &value)
StoreBuffer::Block StoreBufferBlock
static constexpr int kMarkingStackBlockSize
MarkingStack::Block MarkingStackBlock
static constexpr int kPromotionStackBlockSize
PromotionStack::Block PromotionStackBlock
BlockWorkList< PromotionStack > PromotionWorkList
static constexpr int kStoreBufferBlockSize
BlockWorkList< MarkingStack > MarkerWorkList
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network policy
#define OFFSET_OF(type, field)