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

#include <object.h>

Inheritance diagram for dart::ObjectPool:
dart::Object

Classes

struct  ArrayTraits
 
struct  Entry
 

Public Types

using EntryType = compiler::ObjectPoolBuilderEntry::EntryType
 
using Patchability = compiler::ObjectPoolBuilderEntry::Patchability
 
using SnapshotBehavior = compiler::ObjectPoolBuilderEntry::SnapshotBehavior
 
using TypeBits = compiler::ObjectPoolBuilderEntry::TypeBits
 
using PatchableBit = compiler::ObjectPoolBuilderEntry::PatchableBit
 
using SnapshotBehaviorBits = compiler::ObjectPoolBuilderEntry::SnapshotBehaviorBits
 
- Public Types inherited from dart::Object
enum  NameVisibility { kInternalName = 0 , kScrubbedName , kUserVisibleName }
 
enum class  NameDisambiguation { kYes , kNo }
 
using UntaggedObjectType = UntaggedObject
 
using ObjectPtrType = ObjectPtr
 

Public Member Functions

intptr_t Length () const
 
void SetLength (intptr_t value) const
 
EntryType TypeAt (intptr_t index) const
 
Patchability PatchableAt (intptr_t index) const
 
SnapshotBehavior SnapshotBehaviorAt (intptr_t index) const
 
void SetTypeAt (intptr_t index, EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior) const
 
template<std::memory_order order = std::memory_order_relaxed>
ObjectPtr ObjectAt (intptr_t index) const
 
template<std::memory_order order = std::memory_order_relaxed>
void SetObjectAt (intptr_t index, const Object &obj) const
 
uword RawValueAt (intptr_t index) const
 
void SetRawValueAt (intptr_t index, uword raw_value) const
 
void CopyInto (compiler::ObjectPoolBuilder *builder) const
 
void DebugPrint () const
 
- Public Member Functions inherited from dart::Object
virtual ~Object ()
 
ObjectPtr ptr () const
 
void operator= (ObjectPtr value)
 
bool IsCanonical () const
 
void SetCanonical () const
 
void ClearCanonical () const
 
bool IsImmutable () const
 
void SetImmutable () const
 
void ClearImmutable () const
 
intptr_t GetClassId () const
 
ClassPtr clazz () const
 
 CLASS_LIST_FOR_HANDLES (DEFINE_CLASS_TESTER)
 
bool IsNull () const
 
virtual const char * ToCString () const
 
void PrintJSON (JSONStream *stream, bool ref=true) const
 
virtual void PrintJSONImpl (JSONStream *stream, bool ref) const
 
void PrintImplementationFields (JSONStream *stream) const
 
virtual void PrintImplementationFieldsImpl (const JSONArray &jsarr_fields) const
 
virtual const char * JSONType () const
 
virtual StringPtr DictionaryName () const
 
bool IsNew () const
 
bool IsOld () const
 
bool InVMIsolateHeap () const
 
void Print () const
 

Static Public Member Functions

static intptr_t length_offset ()
 
static intptr_t data_offset ()
 
static intptr_t element_offset (intptr_t index)
 
static uint8_t EncodeBits (EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior)
 
static intptr_t InstanceSize ()
 
static intptr_t InstanceSize (intptr_t len)
 
static ObjectPoolPtr NewFromBuilder (const compiler::ObjectPoolBuilder &builder)
 
static ObjectPoolPtr New (intptr_t len)
 
static intptr_t IndexFromOffset (intptr_t offset)
 
static intptr_t OffsetFromIndex (intptr_t index)
 
- Static Public Member Functions inherited from dart::Object
static ObjectPtr RawCast (ObjectPtr obj)
 
static constexpr bool ContainsCompressedPointers ()
 
static intptr_t tags_offset ()
 
static ObjectHandle ()
 
static ObjectHandle (Zone *zone)
 
static ObjectHandle (ObjectPtr ptr)
 
static ObjectHandle (Zone *zone, ObjectPtr ptr)
 
static ObjectZoneHandle ()
 
static ObjectZoneHandle (Zone *zone)
 
static ObjectZoneHandle (ObjectPtr ptr)
 
static ObjectZoneHandle (Zone *zone, ObjectPtr ptr)
 
static ObjectReadOnlyHandle ()
 
static ObjectPtr null ()
 
static void set_vm_isolate_snapshot_object_table (const Array &table)
 
static ClassPtr class_class ()
 
static ClassPtr dynamic_class ()
 
static ClassPtr void_class ()
 
static ClassPtr type_parameters_class ()
 
static ClassPtr type_arguments_class ()
 
static ClassPtr patch_class_class ()
 
static ClassPtr function_class ()
 
static ClassPtr closure_data_class ()
 
static ClassPtr ffi_trampoline_data_class ()
 
static ClassPtr field_class ()
 
static ClassPtr script_class ()
 
static ClassPtr library_class ()
 
static ClassPtr namespace_class ()
 
static ClassPtr kernel_program_info_class ()
 
static ClassPtr code_class ()
 
static ClassPtr instructions_class ()
 
static ClassPtr instructions_section_class ()
 
static ClassPtr instructions_table_class ()
 
static ClassPtr object_pool_class ()
 
static ClassPtr pc_descriptors_class ()
 
static ClassPtr code_source_map_class ()
 
static ClassPtr compressed_stackmaps_class ()
 
static ClassPtr var_descriptors_class ()
 
static ClassPtr exception_handlers_class ()
 
static ClassPtr context_class ()
 
static ClassPtr context_scope_class ()
 
static ClassPtr sentinel_class ()
 
static ClassPtr api_error_class ()
 
static ClassPtr language_error_class ()
 
static ClassPtr unhandled_exception_class ()
 
static ClassPtr unwind_error_class ()
 
static ClassPtr singletargetcache_class ()
 
static ClassPtr unlinkedcall_class ()
 
static ClassPtr monomorphicsmiablecall_class ()
 
static ClassPtr icdata_class ()
 
static ClassPtr megamorphic_cache_class ()
 
static ClassPtr subtypetestcache_class ()
 
static ClassPtr loadingunit_class ()
 
static ClassPtr weak_serialization_reference_class ()
 
static ClassPtr weak_array_class ()
 
static void InitNullAndBool (IsolateGroup *isolate_group)
 
static void Init (IsolateGroup *isolate_group)
 
static void InitVtables ()
 
static void FinishInit (IsolateGroup *isolate_group)
 
static void FinalizeVMIsolate (IsolateGroup *isolate_group)
 
static void FinalizeReadOnlyObject (ObjectPtr object)
 
static void Cleanup ()
 
static ErrorPtr Init (IsolateGroup *isolate_group, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
 
static void MakeUnusedSpaceTraversable (const Object &obj, intptr_t original_size, intptr_t used_size)
 
static intptr_t InstanceSize ()
 
template<class FakeObject >
static void VerifyBuiltinVtable (intptr_t cid)
 
static void VerifyBuiltinVtables ()
 
static bool ShouldHaveImmutabilityBitSet (classid_t class_id)
 

Static Public Attributes

static constexpr intptr_t kBytesPerElement
 
static constexpr intptr_t kMaxElements = kSmiMax / kBytesPerElement
 
- Static Public Attributes inherited from dart::Object
static constexpr intptr_t kHashBits = 30
 
static const ClassId kClassId = kObjectCid
 

Friends

class Class
 
class Object
 
class UntaggedObjectPool
 

Additional Inherited Members

- Protected Member Functions inherited from dart::Object
 Object ()
 
uword raw_value () const
 
void setPtr (ObjectPtr value, intptr_t default_cid)
 
void CheckHandle () const
 
cpp_vtable vtable () const
 
void set_vtable (cpp_vtable value)
 
bool Contains (uword addr) const
 
template<typename type , std::memory_order order = std::memory_order_relaxed>
type LoadPointer (type const *addr) const
 
template<typename type , std::memory_order order = std::memory_order_relaxed>
void StorePointer (type const *addr, type value) const
 
template<typename type , typename compressed_type , std::memory_order order = std::memory_order_relaxed>
void StoreCompressedPointer (compressed_type const *addr, type value) const
 
template<typename type >
void StorePointerUnaligned (type const *addr, type value, Thread *thread) const
 
void StoreSmi (SmiPtr const *addr, SmiPtr value) const
 
template<typename FieldType >
void StoreSimd128 (const FieldType *addr, simd128_value_t value) const
 
template<typename FieldType >
FieldType LoadNonPointer (const FieldType *addr) const
 
template<typename FieldType , std::memory_order order>
FieldType LoadNonPointer (const FieldType *addr) const
 
template<typename FieldType , typename ValueType >
void StoreNonPointer (const FieldType *addr, ValueType value) const
 
template<typename FieldType , typename ValueType , std::memory_order order>
void StoreNonPointer (const FieldType *addr, ValueType value) const
 
template<typename FieldType >
FieldType * UnsafeMutableNonPointer (const FieldType *addr) const
 
 CLASS_LIST (STORE_NON_POINTER_ILLEGAL_TYPE)
 
void UnimplementedMethod () const
 
void AddCommonObjectProperties (JSONObject *jsobj, const char *protocol_type, bool ref) const
 
- Static Protected Member Functions inherited from dart::Object
static DART_NOINLINE ObjectHandleImpl (Zone *zone, ObjectPtr ptr, intptr_t default_cid)
 
static DART_NOINLINE ObjectZoneHandleImpl (Zone *zone, ObjectPtr ptr, intptr_t default_cid)
 
static DART_NOINLINE ObjectReadOnlyHandleImpl (intptr_t cid)
 
static ObjectPtr Allocate (intptr_t cls_id, intptr_t size, Heap::Space space, bool compressed, uword ptr_field_start_offset, uword ptr_field_end_offset)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType Allocate (Heap::Space space)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType Allocate (Heap::Space space, intptr_t elements)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType AllocateVariant (intptr_t class_id, Heap::Space space)
 
template<typename T >
static DART_FORCE_INLINE T::ObjectPtrType AllocateVariant (intptr_t class_id, Heap::Space space, intptr_t elements)
 
static constexpr intptr_t RoundedAllocationSize (intptr_t size)
 
static ObjectPtr Clone (const Object &orig, Heap::Space space, bool load_with_relaxed_atomics=false)
 
template<typename T >
static DART_FORCE_INLINE uword from_offset ()
 
template<typename T >
static DART_FORCE_INLINE uword to_offset (intptr_t length=0)
 
- Protected Attributes inherited from dart::Object
ObjectPtr ptr_
 

Detailed Description

Definition at line 5521 of file object.h.

Member Typedef Documentation

◆ EntryType

Definition at line 5523 of file object.h.

◆ Patchability

Definition at line 5524 of file object.h.

◆ PatchableBit

Definition at line 5527 of file object.h.

◆ SnapshotBehavior

Definition at line 5525 of file object.h.

◆ SnapshotBehaviorBits

Definition at line 5528 of file object.h.

◆ TypeBits

Definition at line 5526 of file object.h.

Member Function Documentation

◆ CopyInto()

void dart::ObjectPool::CopyInto ( compiler::ObjectPoolBuilder builder) const

Definition at line 15749 of file object.cc.

15749 {
15750 ASSERT(builder->CurrentLength() == 0);
15751 for (intptr_t i = 0; i < Length(); i++) {
15752 auto type = TypeAt(i);
15753 auto patchable = PatchableAt(i);
15754 auto snapshot_behavior = SnapshotBehaviorAt(i);
15755 switch (type) {
15757 compiler::ObjectPoolBuilderEntry entry(&Object::ZoneHandle(ObjectAt(i)),
15758 patchable, snapshot_behavior);
15759 builder->AddObject(entry);
15760 break;
15761 }
15764 compiler::ObjectPoolBuilderEntry entry(RawValueAt(i), type, patchable,
15765 snapshot_behavior);
15766 builder->AddObject(entry);
15767 break;
15768 }
15769 default:
15770 UNREACHABLE();
15771 }
15772 }
15773 ASSERT(builder->CurrentLength() == Length());
15774}
#define UNREACHABLE()
Definition assert.h:248
EntryType TypeAt(intptr_t index) const
Definition object.h:5567
ObjectPtr ObjectAt(intptr_t index) const
Definition object.h:5599
intptr_t Length() const
Definition object.h:5543
uword RawValueAt(intptr_t index) const
Definition object.h:5611
SnapshotBehavior SnapshotBehaviorAt(intptr_t index) const
Definition object.h:5577
Patchability PatchableAt(intptr_t index) const
Definition object.h:5572
static Object & ZoneHandle()
Definition object.h:419
#define ASSERT(E)

◆ data_offset()

static intptr_t dart::ObjectPool::data_offset ( )
inlinestatic

Definition at line 5551 of file object.h.

5551 {
5553 }
friend class UntaggedObjectPool
Definition object.h:5674
static int8_t data[kExtLength]
#define OFFSET_OF_RETURNED_VALUE(type, accessor)
Definition globals.h:143

◆ DebugPrint()

void dart::ObjectPool::DebugPrint ( ) const

Definition at line 15782 of file object.cc.

15782 {
15783 THR_Print("ObjectPool len:%" Pd " {\n", Length());
15784 for (intptr_t i = 0; i < Length(); i++) {
15785#if defined(DART_PRECOMPILED_RUNTIME)
15786 intptr_t offset = ObjectPool::element_offset(i);
15787#else
15788 intptr_t offset = compiler::target::ObjectPool::element_offset(i);
15789#endif
15790#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
15791 THR_Print(" %" Pd "(pp) ", offset); // PP is untagged
15792#elif defined(TARGET_ARCH_ARM64)
15793 THR_Print(" [pp, #%" Pd "] ", offset); // PP is untagged
15794#elif defined(TARGET_ARCH_ARM32)
15795 THR_Print(" [pp, #%" Pd "] ", offset - kHeapObjectTag); // PP is tagged
15796#else
15797 THR_Print(" [pp+0x%" Px "] ", offset - kHeapObjectTag); // PP is tagged
15798#endif
15799 if (TypeAt(i) == EntryType::kTaggedObject) {
15800 const Object& obj = Object::Handle(ObjectAt(i));
15801 THR_Print("%s (obj)\n", obj.ToCString());
15802 } else if (TypeAt(i) == EntryType::kNativeFunction) {
15803 uword pc = RawValueAt(i);
15804 uintptr_t start = 0;
15806 char* dso_name;
15807 uword dso_base;
15808 if (name != nullptr) {
15809 THR_Print("%s (native function)\n", name);
15811 } else if (NativeSymbolResolver::LookupSharedObject(pc, &dso_base,
15812 &dso_name)) {
15813 uword dso_offset = pc - dso_base;
15814 THR_Print("%s+0x%" Px " (native function)\n", dso_name, dso_offset);
15816 } else {
15817 THR_Print("0x%" Px " (native function)\n", pc);
15818 }
15819 } else {
15820 THR_Print("0x%" Px " (raw)\n", RawValueAt(i));
15821 }
15822 }
15823 THR_Print("}\n");
15824}
static void FreeSymbolName(char *name)
static bool LookupSharedObject(uword pc, uword *dso_base=nullptr, char **dso_name=nullptr)
static char * LookupSymbolName(uword pc, uword *start)
friend class Object
Definition object.h:5673
static intptr_t element_offset(intptr_t index)
Definition object.h:5554
static Object & Handle()
Definition object.h:407
#define THR_Print(format,...)
Definition log.h:20
const char *const name
@ kHeapObjectTag
uintptr_t uword
Definition globals.h:501
#define Px
Definition globals.h:410
#define Pd
Definition globals.h:408
Point offset

◆ element_offset()

static intptr_t dart::ObjectPool::element_offset ( intptr_t  index)
inlinestatic

Definition at line 5554 of file object.h.

5554 {
5556 sizeof(UntaggedObjectPool::Entry) * index;
5557 }

◆ EncodeBits()

static uint8_t dart::ObjectPool::EncodeBits ( EntryType  type,
Patchability  patchable,
SnapshotBehavior  snapshot_behavior 
)
inlinestatic

Definition at line 5582 of file object.h.

5584 {
5585 return PatchableBit::encode(patchable) | TypeBits::encode(type) |
5586 SnapshotBehaviorBits::encode(snapshot_behavior);
5587 }
static constexpr S encode(T value)
Definition bitfield.h:167

◆ IndexFromOffset()

static intptr_t dart::ObjectPool::IndexFromOffset ( intptr_t  offset)
inlinestatic

Definition at line 5647 of file object.h.

5647 {
5648 ASSERT(
5649 Utils::IsAligned(offset + kHeapObjectTag, compiler::target::kWordSize));
5650#if defined(DART_PRECOMPILER)
5651 return (offset + kHeapObjectTag -
5652 compiler::target::ObjectPool::element_offset(0)) /
5653 compiler::target::kWordSize;
5654#else
5656#endif
5657 }
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition utils.h:77
constexpr intptr_t kWordSize
Definition globals.h:509

◆ InstanceSize() [1/2]

static intptr_t dart::ObjectPool::InstanceSize ( )
inlinestatic

Definition at line 5620 of file object.h.

5620 {
5621 ASSERT(sizeof(UntaggedObjectPool) ==
5623 return 0;
5624 }

◆ InstanceSize() [2/2]

static intptr_t dart::ObjectPool::InstanceSize ( intptr_t  len)
inlinestatic

Definition at line 5630 of file object.h.

5630 {
5631 // Ensure that variable length data is not adding to the object length.
5632 ASSERT(sizeof(UntaggedObjectPool) ==
5633 (sizeof(UntaggedObject) + (1 * kWordSize)));
5634 ASSERT(0 <= len && len <= kMaxElements);
5636 (len * kBytesPerElement));
5637 }
static constexpr intptr_t kMaxElements
Definition object.h:5628
static constexpr intptr_t kBytesPerElement
Definition object.h:5626
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition object.h:758

◆ Length()

intptr_t dart::ObjectPool::Length ( ) const
inline

Definition at line 5543 of file object.h.

5543{ return untag()->length_; }
raw_obj untag() -> num_entries()) VARIABLE_COMPRESSED_VISITOR(Array, Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(TypedData, TypedData::ElementSizeInBytes(raw_obj->GetClassId()) *Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(Record, RecordShape(raw_obj->untag() ->shape()).num_fields()) VARIABLE_NULL_VISITOR(CompressedStackMaps, CompressedStackMaps::PayloadSizeOf(raw_obj)) VARIABLE_NULL_VISITOR(OneByteString, Smi::Value(raw_obj->untag() ->length())) VARIABLE_NULL_VISITOR(TwoByteString, Smi::Value(raw_obj->untag() ->length())) intptr_t UntaggedField::VisitFieldPointers(FieldPtr raw_obj, ObjectPointerVisitor *visitor)

◆ length_offset()

static intptr_t dart::ObjectPool::length_offset ( )
inlinestatic

Definition at line 5548 of file object.h.

5548 {
5549 return OFFSET_OF(UntaggedObjectPool, length_);
5550 }
#define OFFSET_OF(type, field)
Definition globals.h:138

◆ New()

ObjectPoolPtr dart::ObjectPool::New ( intptr_t  len)
static

Definition at line 15699 of file object.cc.

15699 {
15701 if (len < 0 || len > kMaxElements) {
15702 // This should be caught before we reach here.
15703 FATAL("Fatal error in ObjectPool::New: invalid length %" Pd "\n", len);
15704 }
15705 // We only verify the entry bits in DEBUG, so only allocate a handle there.
15707 auto raw = Object::Allocate<ObjectPool>(Heap::kOld, len);
15708 NoSafepointScope no_safepoint;
15709 raw->untag()->length_ = len;
15710#if defined(DEBUG)
15711 result = raw;
15712 for (intptr_t i = 0; i < len; i++) {
15713 // Verify that InitializeObject() already set the payload as expected.
15714 ASSERT_EQUAL(result.PatchableAt(i), ObjectPool::Patchability::kPatchable);
15715 ASSERT_EQUAL(result.TypeAt(i), ObjectPool::EntryType::kImmediate);
15716 ASSERT_EQUAL(result.RawValueAt(i), 0);
15717 }
15718#endif
15719 return raw;
15720}
#define ASSERT_EQUAL(expected, actual)
Definition assert.h:309
@ kOld
Definition heap.h:39
static ObjectPtr null()
Definition object.h:433
static ClassPtr object_pool_class()
Definition object.h:539
#define FATAL(error)
GAsyncResult * result
#define DEBUG_ONLY(code)
Definition globals.h:141

◆ NewFromBuilder()

ObjectPoolPtr dart::ObjectPool::NewFromBuilder ( const compiler::ObjectPoolBuilder builder)
static

Definition at line 15723 of file object.cc.

15724 {
15725 const intptr_t len = builder.CurrentLength();
15726 if (len == 0) {
15727 return Object::empty_object_pool().ptr();
15728 }
15729 const ObjectPool& result = ObjectPool::Handle(ObjectPool::New(len));
15730 for (intptr_t i = 0; i < len; i++) {
15731 auto entry = builder.EntryAt(i);
15732 auto type = entry.type();
15733 auto patchable = entry.patchable();
15734 auto snapshot_behavior = entry.snapshot_behavior();
15735 result.SetTypeAt(i, type, patchable, snapshot_behavior);
15736 if (type == EntryType::kTaggedObject) {
15737 result.SetObjectAt(i, *entry.obj_);
15738 } else {
15739#if defined(TARGET_ARCH_IS_32_BIT)
15740 ASSERT(type != EntryType::kImmediate64);
15741#endif
15742 ASSERT(type != EntryType::kImmediate128);
15743 result.SetRawValueAt(i, entry.imm_);
15744 }
15745 }
15746 return result.ptr();
15747}
static ObjectPoolPtr New(intptr_t len)
Definition object.cc:15699

◆ ObjectAt()

template<std::memory_order order = std::memory_order_relaxed>
ObjectPtr dart::ObjectPool::ObjectAt ( intptr_t  index) const
inline

Definition at line 5599 of file object.h.

5599 {
5600 ASSERT(TypeAt(index) == EntryType::kTaggedObject);
5601 return LoadPointer<ObjectPtr, order>(&(EntryAddr(index)->raw_obj_));
5602 }

◆ OffsetFromIndex()

static intptr_t dart::ObjectPool::OffsetFromIndex ( intptr_t  index)
inlinestatic

Definition at line 5659 of file object.h.

5659 {
5660 return element_offset(index) - kHeapObjectTag;
5661 }

◆ PatchableAt()

Patchability dart::ObjectPool::PatchableAt ( intptr_t  index) const
inline

Definition at line 5572 of file object.h.

5572 {
5573 ASSERT((index >= 0) && (index <= Length()));
5574 return PatchableBit::decode(untag()->entry_bits()[index]);
5575 }
static constexpr T decode(S value)
Definition bitfield.h:173

◆ RawValueAt()

uword dart::ObjectPool::RawValueAt ( intptr_t  index) const
inline

Definition at line 5611 of file object.h.

5611 {
5612 ASSERT(TypeAt(index) != EntryType::kTaggedObject);
5613 return EntryAddr(index)->raw_value_;
5614 }

◆ SetLength()

void dart::ObjectPool::SetLength ( intptr_t  value) const
inline

Definition at line 5544 of file object.h.

5544 {
5545 StoreNonPointer(&untag()->length_, value);
5546 }
void StoreNonPointer(const FieldType *addr, ValueType value) const
Definition object.h:819

◆ SetObjectAt()

template<std::memory_order order = std::memory_order_relaxed>
void dart::ObjectPool::SetObjectAt ( intptr_t  index,
const Object obj 
) const
inline

Definition at line 5605 of file object.h.

5605 {
5606 ASSERT((TypeAt(index) == EntryType::kTaggedObject) ||
5607 (TypeAt(index) == EntryType::kImmediate && obj.IsSmi()));
5608 StorePointer<ObjectPtr, order>(&EntryAddr(index)->raw_obj_, obj.ptr());
5609 }

◆ SetRawValueAt()

void dart::ObjectPool::SetRawValueAt ( intptr_t  index,
uword  raw_value 
) const
inline

Definition at line 5615 of file object.h.

5615 {
5616 ASSERT(TypeAt(index) != EntryType::kTaggedObject);
5617 StoreNonPointer(&EntryAddr(index)->raw_value_, raw_value);
5618 }
uword raw_value() const
Definition object.h:670

◆ SetTypeAt()

void dart::ObjectPool::SetTypeAt ( intptr_t  index,
EntryType  type,
Patchability  patchable,
SnapshotBehavior  snapshot_behavior 
) const
inline

Definition at line 5589 of file object.h.

5592 {
5593 ASSERT(index >= 0 && index <= Length());
5594 const uint8_t bits = EncodeBits(type, patchable, snapshot_behavior);
5595 StoreNonPointer(&untag()->entry_bits()[index], bits);
5596 }
static uint8_t EncodeBits(EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior)
Definition object.h:5582

◆ SnapshotBehaviorAt()

SnapshotBehavior dart::ObjectPool::SnapshotBehaviorAt ( intptr_t  index) const
inline

Definition at line 5577 of file object.h.

5577 {
5578 ASSERT((index >= 0) && (index <= Length()));
5579 return SnapshotBehaviorBits::decode(untag()->entry_bits()[index]);
5580 }

◆ TypeAt()

EntryType dart::ObjectPool::TypeAt ( intptr_t  index) const
inline

Definition at line 5567 of file object.h.

5567 {
5568 ASSERT((index >= 0) && (index <= Length()));
5569 return TypeBits::decode(untag()->entry_bits()[index]);
5570 }

Friends And Related Symbol Documentation

◆ Class

friend class Class
friend

Definition at line 5672 of file object.h.

◆ Object

friend class Object
friend

Definition at line 5673 of file object.h.

◆ UntaggedObjectPool

friend class UntaggedObjectPool
friend

Definition at line 5674 of file object.h.

Member Data Documentation

◆ kBytesPerElement

constexpr intptr_t dart::ObjectPool::kBytesPerElement
staticconstexpr
Initial value:
=
sizeof(UntaggedObjectPool::Entry) + sizeof(uint8_t)

Definition at line 5626 of file object.h.

◆ kMaxElements

constexpr intptr_t dart::ObjectPool::kMaxElements = kSmiMax / kBytesPerElement
staticconstexpr

Definition at line 5628 of file object.h.


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