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

#include <freelist.h>

Classes

class  FakeInstance
 

Public Member Functions

FreeListElementnext () const
 
uword next_address () const
 
void set_next (FreeListElement *next)
 
intptr_t HeapSize ()
 
intptr_t HeapSize (uword tags)
 

Static Public Member Functions

static FreeListElementAsElement (uword addr, intptr_t size)
 
static FreeListElementAsElementNew (uword addr, intptr_t size)
 
static void Init ()
 
static intptr_t HeaderSizeFor (intptr_t size)
 

Static Public Attributes

static constexpr intptr_t kLargeHeaderSize = 3 * kWordSize
 

Detailed Description

Definition at line 24 of file freelist.h.

Member Function Documentation

◆ AsElement()

FreeListElement * dart::FreeListElement::AsElement ( uword  addr,
intptr_t  size 
)
static

Definition at line 16 of file freelist.cc.

16 {
17 // Precondition: the (page containing the) header of the element is
18 // writable.
19 ASSERT(size >= kObjectAlignment);
21
22 FreeListElement* result = reinterpret_cast<FreeListElement*>(addr);
23
24 uword tags = 0;
25 tags = UntaggedObject::SizeTag::update(size, tags);
28 tags = UntaggedObject::AlwaysSetBit::update(true, tags);
29 tags = UntaggedObject::NotMarkedBit::update(true, tags);
31 tags = UntaggedObject::NewBit::update(false, tags);
32 result->tags_ = tags;
33
35 *result->SizeAddress() = size;
36 }
37 result->set_next(nullptr);
38 return result;
39 // Postcondition: the (page containing the) header of the element is
40 // writable.
41}
static constexpr uword update(ClassIdTagType value, uword original)
Definition bitfield.h:190
static constexpr uword update(intptr_t size, uword tag)
Definition raw_object.h:209
static constexpr intptr_t kMaxSizeTag
Definition raw_object.h:198
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition utils.h:77
#define ASSERT(E)
GAsyncResult * result
static constexpr intptr_t kOldObjectAlignmentOffset
static constexpr intptr_t kNewObjectAlignmentOffset
@ kFreeListElement
Definition class_id.h:224
uintptr_t uword
Definition globals.h:501
static constexpr intptr_t kObjectAlignment
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

◆ AsElementNew()

FreeListElement * dart::FreeListElement::AsElementNew ( uword  addr,
intptr_t  size 
)
static

Definition at line 43 of file freelist.cc.

43 {
44 ASSERT(size >= kObjectAlignment);
46
47 FreeListElement* result = reinterpret_cast<FreeListElement*>(addr);
48
49 uword tags = 0;
50 tags = UntaggedObject::SizeTag::update(size, tags);
53 tags = UntaggedObject::AlwaysSetBit::update(true, tags);
54 tags = UntaggedObject::NotMarkedBit::update(true, tags);
56 tags = UntaggedObject::NewBit::update(true, tags);
57 result->tags_ = tags;
58
60 *result->SizeAddress() = size;
61 }
62 result->set_next(nullptr);
63 return result;
64}

◆ HeaderSizeFor()

intptr_t dart::FreeListElement::HeaderSizeFor ( intptr_t  size)
static

Definition at line 71 of file freelist.cc.

71 {
72 if (size == 0) return 0;
73 return ((size > UntaggedObject::SizeTag::kMaxSizeTag) ? 3 : 2) * kWordSize;
74}
constexpr intptr_t kWordSize
Definition globals.h:509

◆ HeapSize() [1/2]

intptr_t dart::FreeListElement::HeapSize ( )
inline

Definition at line 31 of file freelist.h.

31{ return HeapSize(tags_); }
intptr_t HeapSize()
Definition freelist.h:31

◆ HeapSize() [2/2]

intptr_t dart::FreeListElement::HeapSize ( uword  tags)
inline

Definition at line 32 of file freelist.h.

32 {
35 if (size != 0) return size;
36 return *SizeAddress();
37 }
static constexpr uword decode(uword tag)
Definition raw_object.h:205

◆ Init()

void dart::FreeListElement::Init ( )
static

Definition at line 66 of file freelist.cc.

66 {
67 ASSERT(sizeof(FreeListElement) == kObjectAlignment);
68 ASSERT(OFFSET_OF(FreeListElement, tags_) == Object::tags_offset());
69}
static intptr_t tags_offset()
Definition object.h:346
#define OFFSET_OF(type, field)
Definition globals.h:138

◆ next()

FreeListElement * dart::FreeListElement::next ( ) const
inline

Definition at line 26 of file freelist.h.

26{ return next_; }

◆ next_address()

uword dart::FreeListElement::next_address ( ) const
inline

Definition at line 27 of file freelist.h.

27{ return reinterpret_cast<uword>(&next_); }

◆ set_next()

void dart::FreeListElement::set_next ( FreeListElement next)
inline

Definition at line 29 of file freelist.h.

29{ next_ = next; }
FreeListElement * next() const
Definition freelist.h:26

Member Data Documentation

◆ kLargeHeaderSize

constexpr intptr_t dart::FreeListElement::kLargeHeaderSize = 3 * kWordSize
staticconstexpr

Definition at line 44 of file freelist.h.


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