Flutter Engine
The Flutter Engine
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 760 of file scavenger.cc.

761 : 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 763 of file scavenger.cc.

763 {
764 Page* page = head_;
765 while (page != nullptr) {
766 Page* next = page->next();
767 page->Deallocate();
768 page = next;
769 }
770}
static float next(float f)

Member Function Documentation

◆ AddList()

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

Definition at line 805 of file scavenger.cc.

805 {
806 if (head == nullptr) {
807 return;
808 }
809 if (head_ == nullptr) {
810 head_ = head;
811 tail_ = tail;
812 return;
813 }
814 tail_->set_next(head);
815 tail_ = tail;
816}
void set_next(Page *next)
Definition: page.h:103
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 792 of file scavenger.cc.

792 {
793 for (Page* page = head_; page != nullptr; page = page->next()) {
794 if (page->Contains(addr)) return true;
795 }
796 return false;
797}

◆ 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 772 of file scavenger.cc.

772 {
773 if (capacity_in_words_ >= gc_threshold_in_words_) {
774 return nullptr; // Full.
775 }
776 Page* page = Page::Allocate(kPageSize, Page::kNew);
777 if (page == nullptr) {
778 return nullptr; // Out of memory;
779 }
780 capacity_in_words_ += kPageSizeInWords;
781 if (link) {
782 if (head_ == nullptr) {
783 head_ = tail_ = page;
784 } else {
785 tail_->set_next(page);
786 tail_ = page;
787 }
788 }
789 return page;
790}
@ kNew
Definition: page.h:73
def link(from_root, to_root)
Definition: dart_pkg.py:44
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 799 of file scavenger.cc.

799 {
800 for (Page* page = head_; page != nullptr; page = page->next()) {
801 page->WriteProtect(read_only);
802 }
803}

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