Flutter Engine
The Flutter Engine
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 5550 of file object.h.

Member Typedef Documentation

◆ EntryType

Definition at line 5552 of file object.h.

◆ Patchability

Definition at line 5553 of file object.h.

◆ PatchableBit

Definition at line 5556 of file object.h.

◆ SnapshotBehavior

Definition at line 5554 of file object.h.

◆ SnapshotBehaviorBits

Definition at line 5557 of file object.h.

◆ TypeBits

Definition at line 5555 of file object.h.

Member Function Documentation

◆ CopyInto()

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

Definition at line 15702 of file object.cc.

15702 {
15703 ASSERT(builder->CurrentLength() == 0);
15704 for (intptr_t i = 0; i < Length(); i++) {
15705 auto type = TypeAt(i);
15706 auto patchable = PatchableAt(i);
15707 auto snapshot_behavior = SnapshotBehaviorAt(i);
15708 switch (type) {
15710 compiler::ObjectPoolBuilderEntry entry(&Object::ZoneHandle(ObjectAt(i)),
15711 patchable, snapshot_behavior);
15712 builder->AddObject(entry);
15713 break;
15714 }
15717 compiler::ObjectPoolBuilderEntry entry(RawValueAt(i), type, patchable,
15718 snapshot_behavior);
15719 builder->AddObject(entry);
15720 break;
15721 }
15722 default:
15723 UNREACHABLE();
15724 }
15725 }
15726 ASSERT(builder->CurrentLength() == Length());
15727}
#define UNREACHABLE()
Definition: assert.h:248
GLenum type
EntryType TypeAt(intptr_t index) const
Definition: object.h:5596
ObjectPtr ObjectAt(intptr_t index) const
Definition: object.h:5628
intptr_t Length() const
Definition: object.h:5572
uword RawValueAt(intptr_t index) const
Definition: object.h:5640
SnapshotBehavior SnapshotBehaviorAt(intptr_t index) const
Definition: object.h:5606
Patchability PatchableAt(intptr_t index) const
Definition: object.h:5601
static Object & ZoneHandle()
Definition: object.h:419
#define ASSERT(E)

◆ data_offset()

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

Definition at line 5580 of file object.h.

5580 {
5582 }
friend class UntaggedObjectPool
Definition: object.h:5703
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 15735 of file object.cc.

15735 {
15736 THR_Print("ObjectPool len:%" Pd " {\n", Length());
15737 for (intptr_t i = 0; i < Length(); i++) {
15738#if defined(DART_PRECOMPILED_RUNTIME)
15740#else
15742#endif
15743#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
15744 THR_Print(" %" Pd "(pp) ", offset); // PP is untagged
15745#elif defined(TARGET_ARCH_ARM64)
15746 THR_Print(" [pp, #%" Pd "] ", offset); // PP is untagged
15747#elif defined(TARGET_ARCH_ARM32)
15748 THR_Print(" [pp, #%" Pd "] ", offset - kHeapObjectTag); // PP is tagged
15749#else
15750 THR_Print(" [pp+0x%" Px "] ", offset - kHeapObjectTag); // PP is tagged
15751#endif
15752 if (TypeAt(i) == EntryType::kTaggedObject) {
15753 const Object& obj = Object::Handle(ObjectAt(i));
15754 THR_Print("%s (obj)\n", obj.ToCString());
15755 } else if (TypeAt(i) == EntryType::kNativeFunction) {
15756 uword pc = RawValueAt(i);
15757 uintptr_t start = 0;
15758 const char* name = NativeSymbolResolver::LookupSymbolName(pc, &start);
15759 const char* dso_name;
15760 uword dso_base;
15761 if (name != nullptr) {
15762 THR_Print("%s (native function)\n", name);
15764 } else if (NativeSymbolResolver::LookupSharedObject(pc, &dso_base,
15765 &dso_name)) {
15766 uword dso_offset = pc - dso_base;
15767 THR_Print("%s+0x%" Px " (native function)\n", dso_name, dso_offset);
15769 } else {
15770 THR_Print("0x%" Px " (native function)\n", pc);
15771 }
15772 } else {
15773 THR_Print("0x%" Px " (raw)\n", RawValueAt(i));
15774 }
15775 }
15776 THR_Print("}\n");
15777}
static bool LookupSharedObject(uword pc, uword *dso_base=nullptr, const char **dso_name=nullptr)
static const char * LookupSymbolName(uword pc, uword *start)
static void FreeSymbolName(const char *name)
friend class Object
Definition: object.h:5702
static intptr_t element_offset(intptr_t index)
Definition: object.h:5583
static Object & Handle()
Definition: object.h:407
static word element_offset(intptr_t index)
#define THR_Print(format,...)
Definition: log.h:20
const char *const name
uintptr_t uword
Definition: globals.h:501
@ kHeapObjectTag
#define Px
Definition: globals.h:410
#define Pd
Definition: globals.h:408
SeparatedVector2 offset

◆ element_offset()

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

Definition at line 5583 of file object.h.

◆ EncodeBits()

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

Definition at line 5611 of file object.h.

5613 {
5614 return PatchableBit::encode(patchable) | TypeBits::encode(type) |
5615 SnapshotBehaviorBits::encode(snapshot_behavior);
5616 }
static constexpr S encode(T value)
Definition: bitfield.h:165

◆ IndexFromOffset()

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

Definition at line 5676 of file object.h.

5676 {
5677 ASSERT(
5679#if defined(DART_PRECOMPILER)
5680 return (offset + kHeapObjectTag -
5683#else
5685#endif
5686 }
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:92
static constexpr intptr_t kWordSize
Definition: runtime_api.h:274
constexpr intptr_t kWordSize
Definition: globals.h:509

◆ InstanceSize() [1/2]

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

Definition at line 5649 of file object.h.

5649 {
5650 ASSERT(sizeof(UntaggedObjectPool) ==
5652 return 0;
5653 }

◆ InstanceSize() [2/2]

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

Definition at line 5659 of file object.h.

5659 {
5660 // Ensure that variable length data is not adding to the object length.
5661 ASSERT(sizeof(UntaggedObjectPool) ==
5662 (sizeof(UntaggedObject) + (1 * kWordSize)));
5663 ASSERT(0 <= len && len <= kMaxElements);
5665 (len * kBytesPerElement));
5666 }
static constexpr intptr_t kMaxElements
Definition: object.h:5657
static constexpr intptr_t kBytesPerElement
Definition: object.h:5655
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition: object.h:758

◆ Length()

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

Definition at line 5572 of file object.h.

5572{ 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)
Definition: raw_object.cc:558

◆ length_offset()

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

Definition at line 5577 of file object.h.

5577 {
5578 return OFFSET_OF(UntaggedObjectPool, length_);
5579 }
#define OFFSET_OF(type, field)
Definition: globals.h:138

◆ New()

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

Definition at line 15652 of file object.cc.

15652 {
15654 if (len < 0 || len > kMaxElements) {
15655 // This should be caught before we reach here.
15656 FATAL("Fatal error in ObjectPool::New: invalid length %" Pd "\n", len);
15657 }
15658 // We only verify the entry bits in DEBUG, so only allocate a handle there.
15660 auto raw = Object::Allocate<ObjectPool>(Heap::kOld, len);
15661 NoSafepointScope no_safepoint;
15662 raw->untag()->length_ = len;
15663#if defined(DEBUG)
15664 result = raw;
15665 for (intptr_t i = 0; i < len; i++) {
15666 // Verify that InitializeObject() already set the payload as expected.
15667 ASSERT_EQUAL(result.PatchableAt(i), ObjectPool::Patchability::kPatchable);
15668 ASSERT_EQUAL(result.TypeAt(i), ObjectPool::EntryType::kImmediate);
15669 ASSERT_EQUAL(result.RawValueAt(i), 0);
15670 }
15671#endif
15672 return raw;
15673}
#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 15676 of file object.cc.

15677 {
15678 const intptr_t len = builder.CurrentLength();
15679 if (len == 0) {
15680 return Object::empty_object_pool().ptr();
15681 }
15682 const ObjectPool& result = ObjectPool::Handle(ObjectPool::New(len));
15683 for (intptr_t i = 0; i < len; i++) {
15684 auto entry = builder.EntryAt(i);
15685 auto type = entry.type();
15686 auto patchable = entry.patchable();
15687 auto snapshot_behavior = entry.snapshot_behavior();
15688 result.SetTypeAt(i, type, patchable, snapshot_behavior);
15689 if (type == EntryType::kTaggedObject) {
15690 result.SetObjectAt(i, *entry.obj_);
15691 } else {
15692#if defined(TARGET_ARCH_IS_32_BIT)
15693 ASSERT(type != EntryType::kImmediate64);
15694#endif
15695 ASSERT(type != EntryType::kImmediate128);
15696 result.SetRawValueAt(i, entry.imm_);
15697 }
15698 }
15699 return result.ptr();
15700}
static ObjectPoolPtr New(intptr_t len)
Definition: object.cc:15652

◆ ObjectAt()

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

Definition at line 5628 of file object.h.

5628 {
5629 ASSERT(TypeAt(index) == EntryType::kTaggedObject);
5630 return LoadPointer<ObjectPtr, order>(&(EntryAddr(index)->raw_obj_));
5631 }

◆ OffsetFromIndex()

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

Definition at line 5688 of file object.h.

5688 {
5689 return element_offset(index) - kHeapObjectTag;
5690 }

◆ PatchableAt()

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

Definition at line 5601 of file object.h.

5601 {
5602 ASSERT((index >= 0) && (index <= Length()));
5603 return PatchableBit::decode(untag()->entry_bits()[index]);
5604 }
static constexpr T decode(S value)
Definition: bitfield.h:171

◆ RawValueAt()

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

Definition at line 5640 of file object.h.

5640 {
5641 ASSERT(TypeAt(index) != EntryType::kTaggedObject);
5642 return EntryAddr(index)->raw_value_;
5643 }

◆ SetLength()

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

Definition at line 5573 of file object.h.

5573 {
5574 StoreNonPointer(&untag()->length_, value);
5575 }
void StoreNonPointer(const FieldType *addr, ValueType value) const
Definition: object.h:819
uint8_t value

◆ 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 5634 of file object.h.

5634 {
5635 ASSERT((TypeAt(index) == EntryType::kTaggedObject) ||
5636 (TypeAt(index) == EntryType::kImmediate && obj.IsSmi()));
5637 StorePointer<ObjectPtr, order>(&EntryAddr(index)->raw_obj_, obj.ptr());
5638 }

◆ SetRawValueAt()

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

Definition at line 5644 of file object.h.

5644 {
5645 ASSERT(TypeAt(index) != EntryType::kTaggedObject);
5646 StoreNonPointer(&EntryAddr(index)->raw_value_, raw_value);
5647 }
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 5618 of file object.h.

5621 {
5622 ASSERT(index >= 0 && index <= Length());
5623 const uint8_t bits = EncodeBits(type, patchable, snapshot_behavior);
5624 StoreNonPointer(&untag()->entry_bits()[index], bits);
5625 }
static uint8_t EncodeBits(EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior)
Definition: object.h:5611

◆ SnapshotBehaviorAt()

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

Definition at line 5606 of file object.h.

5606 {
5607 ASSERT((index >= 0) && (index <= Length()));
5608 return SnapshotBehaviorBits::decode(untag()->entry_bits()[index]);
5609 }

◆ TypeAt()

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

Definition at line 5596 of file object.h.

5596 {
5597 ASSERT((index >= 0) && (index <= Length()));
5598 return TypeBits::decode(untag()->entry_bits()[index]);
5599 }

Friends And Related Function Documentation

◆ Class

friend class Class
friend

Definition at line 5701 of file object.h.

◆ Object

friend class Object
friend

Definition at line 5702 of file object.h.

◆ UntaggedObjectPool

friend class UntaggedObjectPool
friend

Definition at line 5703 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 5655 of file object.h.

◆ kMaxElements

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

Definition at line 5657 of file object.h.


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