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

#include <scavenger.h>

Public Member Functions

 SemiSpace (intptr_t gc_threshold_in_words)
 
 ~SemiSpace ()
 
PageTryAllocatePageLocked (bool link)
 
bool Contains (uword addr) const
 
void WriteProtect (bool read_only)
 
intptr_t used_in_words () const
 
intptr_t capacity_in_words () const
 
intptr_t gc_threshold_in_words () const
 
Pagehead () const
 
void AddList (Page *head, Page *tail)
 

Detailed Description

Definition at line 37 of file scavenger.h.

Constructor & Destructor Documentation

◆ SemiSpace()

dart::SemiSpace::SemiSpace ( intptr_t  gc_threshold_in_words)
explicit

Definition at line 709 of file scavenger.cc.

710 : gc_threshold_in_words_(gc_threshold_in_words) {}
intptr_t gc_threshold_in_words() const
Definition scavenger.h:55

◆ ~SemiSpace()

dart::SemiSpace::~SemiSpace ( )

Definition at line 712 of file scavenger.cc.

712 {
713 Page* page = head_;
714 while (page != nullptr) {
715 Page* next = page->next();
716 page->Deallocate();
717 page = next;
718 }
719}
static float next(float f)

Member Function Documentation

◆ AddList()

void dart::SemiSpace::AddList ( Page head,
Page tail 
)

Definition at line 754 of file scavenger.cc.

754 {
755 if (head == nullptr) {
756 return;
757 }
758 if (head_ == nullptr) {
759 head_ = head;
760 tail_ = tail;
761 return;
762 }
763 tail_->set_next(head);
764 tail_ = tail;
765}
void set_next(Page *next)
Definition page.h:87
Page * head() const
Definition scavenger.h:57

◆ capacity_in_words()

intptr_t dart::SemiSpace::capacity_in_words ( ) const
inline

Definition at line 54 of file scavenger.h.

54{ return capacity_in_words_; }

◆ Contains()

bool dart::SemiSpace::Contains ( uword  addr) const

Definition at line 741 of file scavenger.cc.

741 {
742 for (Page* page = head_; page != nullptr; page = page->next()) {
743 if (page->Contains(addr)) return true;
744 }
745 return false;
746}

◆ gc_threshold_in_words()

intptr_t dart::SemiSpace::gc_threshold_in_words ( ) const
inline

Definition at line 55 of file scavenger.h.

55{ return gc_threshold_in_words_; }

◆ head()

Page * dart::SemiSpace::head ( ) const
inline

Definition at line 57 of file scavenger.h.

57{ return head_; }

◆ TryAllocatePageLocked()

Page * dart::SemiSpace::TryAllocatePageLocked ( bool  link)

Definition at line 721 of file scavenger.cc.

721 {
722 if (capacity_in_words_ >= gc_threshold_in_words_) {
723 return nullptr; // Full.
724 }
725 Page* page = Page::Allocate(kPageSize, Page::kNew);
726 if (page == nullptr) {
727 return nullptr; // Out of memory;
728 }
729 capacity_in_words_ += kPageSizeInWords;
730 if (link) {
731 if (head_ == nullptr) {
732 head_ = tail_ = page;
733 } else {
734 tail_->set_next(page);
735 tail_ = page;
736 }
737 }
738 return page;
739}
@ kNew
Definition page.h:73
static constexpr intptr_t kPageSizeInWords
Definition page.h:28
static constexpr intptr_t kPageSize
Definition page.h:27

◆ used_in_words()

intptr_t dart::SemiSpace::used_in_words ( ) const
inline

Definition at line 47 of file scavenger.h.

47 {
48 intptr_t size = 0;
49 for (const Page* p = head_; p != nullptr; p = p->next()) {
50 size += p->used();
51 }
52 return size >> kWordSizeLog2;
53 }
constexpr intptr_t kWordSizeLog2
Definition globals.h:507
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 JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259

◆ WriteProtect()

void dart::SemiSpace::WriteProtect ( bool  read_only)

Definition at line 748 of file scavenger.cc.

748 {
749 for (Page* page = head_; page != nullptr; page = page->next()) {
750 page->WriteProtect(read_only);
751 }
752}

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