Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Protected Member Functions | Friends | List of all members
dart::UntaggedTypedDataBase Class Reference

#include <raw_object.h>

Inheritance diagram for dart::UntaggedTypedDataBase:
dart::UntaggedPointerBase dart::UntaggedInstance dart::UntaggedObject dart::UntaggedExternalTypedData dart::UntaggedTypedData dart::UntaggedTypedDataView

Protected Member Functions

 COMPRESSED_SMI_FIELD (SmiPtr, length)
 
- Protected Member Functions inherited from dart::UntaggedObject
template<typename type , std::memory_order order = std::memory_order_relaxed>
type LoadPointer (type const *addr) const
 
template<typename type , typename compressed_type , std::memory_order order = std::memory_order_relaxed>
type LoadCompressedPointer (compressed_type const *addr) const
 
uword heap_base () const
 
template<typename type , std::memory_order order = std::memory_order_relaxed>
void StorePointer (type const *addr, type value)
 
template<typename type , typename compressed_type , std::memory_order order = std::memory_order_relaxed>
void StoreCompressedPointer (compressed_type const *addr, type value)
 
template<typename type >
void StorePointer (type const *addr, type value, Thread *thread)
 
template<typename type , typename compressed_type >
void StoreCompressedPointer (compressed_type const *addr, type value, Thread *thread)
 
template<typename type >
void StorePointerUnaligned (type const *addr, type value, Thread *thread)
 
template<typename type , std::memory_order order = std::memory_order_relaxed, typename value_type = type>
void StoreArrayPointer (type const *addr, value_type value)
 
template<typename type , typename value_type = type>
void StoreArrayPointer (type const *addr, value_type value, Thread *thread)
 
template<typename type , typename compressed_type , std::memory_order order>
void StoreCompressedArrayPointer (compressed_type const *addr, type value)
 
template<typename type , typename compressed_type , std::memory_order order>
void StoreCompressedArrayPointer (compressed_type const *addr, type value, Thread *thread)
 
template<typename type , typename compressed_type >
void StoreCompressedArrayPointer (compressed_type const *addr, type value, Thread *thread)
 
template<typename type , typename compressed_type , std::memory_order order = std::memory_order_relaxed>
type ExchangeCompressedPointer (compressed_type const *addr, type value)
 
template<std::memory_order order = std::memory_order_relaxed>
SmiPtr LoadSmi (SmiPtr const *addr) const
 
template<std::memory_order order = std::memory_order_relaxed>
SmiPtr LoadCompressedSmi (CompressedSmiPtr const *addr) const
 
template<typename type , std::memory_order order = std::memory_order_relaxed>
void StoreSmi (type const *addr, type value)
 
template<std::memory_order order = std::memory_order_relaxed>
void StoreCompressedSmi (CompressedSmiPtr const *addr, SmiPtr value)
 

Friends

class UntaggedTypedDataView
 
void UpdateLengthField (intptr_t, ObjectPtr, ObjectPtr)
 
void InitializeExternalTypedData (intptr_t, ExternalTypedDataPtr, ExternalTypedDataPtr)
 
void InitializeExternalTypedDataWithSafepointChecks (Thread *, intptr_t, const ExternalTypedData &, const ExternalTypedData &)
 

Additional Inherited Members

- Public Types inherited from dart::UntaggedObject
enum  TagBits {
  kCardRememberedBit = 0 , kCanonicalBit = 1 , kNotMarkedBit = 2 , kNewBit = 3 ,
  kAlwaysSetBit = 4 , kOldAndNotRememberedBit = 5 , kImmutableBit = 6 , kReservedBit = 7 ,
  kSizeTagPos = kReservedBit + 1 , kSizeTagSize = 4 , kClassIdTagPos = kSizeTagPos + kSizeTagSize , kClassIdTagSize = 20 ,
  kHashTagPos = kClassIdTagPos + kClassIdTagSize , kHashTagSize = 32
}
 
- Public Member Functions inherited from dart::UntaggedPointerBase
uint8_t * data ()
 
- Public Member Functions inherited from dart::UntaggedObject
 COMPILE_ASSERT (kNotMarkedBit+kBarrierOverlapShift==kAlwaysSetBit)
 
 COMPILE_ASSERT (kNewBit+kBarrierOverlapShift==kOldAndNotRememberedBit)
 
 COMPILE_ASSERT (kCardRememberedBit==0)
 
 COMPILE_ASSERT (kBitsPerByte *sizeof(ClassIdTagType) >=kClassIdTagSize)
 
 COMPILE_ASSERT (kClassIdTagMax==(1<< kClassIdTagSize) - 1)
 
bool IsNewObject () const
 
bool IsOldObject () const
 
uword tags () const
 
bool IsMarked () const
 
bool IsMarkedIgnoreRace () const
 
void SetMarkBit ()
 
void SetMarkBitUnsynchronized ()
 
void SetMarkBitRelease ()
 
void ClearMarkBit ()
 
void ClearMarkBitUnsynchronized ()
 
DART_WARN_UNUSED_RESULT bool TryAcquireMarkBit ()
 
bool IsCanonical () const
 
void SetCanonical ()
 
void ClearCanonical ()
 
bool IsImmutable () const
 
void SetImmutable ()
 
void ClearImmutable ()
 
bool InVMIsolateHeap () const
 
bool IsRemembered () const
 
bool TryAcquireRememberedBit ()
 
void ClearRememberedBit ()
 
void ClearRememberedBitUnsynchronized ()
 
DART_FORCE_INLINE void EnsureInRememberedSet (Thread *thread)
 
bool IsCardRemembered () const
 
void SetCardRememberedBitUnsynchronized ()
 
intptr_t GetClassId () const
 
intptr_t HeapSize () const
 
intptr_t HeapSize (uword tags) const
 
bool Contains (uword addr) const
 
void Validate (IsolateGroup *isolate_group) const
 
intptr_t VisitPointers (ObjectPointerVisitor *visitor)
 
template<class V >
DART_FORCE_INLINE intptr_t VisitPointersNonvirtual (V *visitor)
 
void VisitPointersPrecise (ObjectPointerVisitor *visitor)
 
- Static Public Member Functions inherited from dart::UntaggedObject
static bool IsMarked (uword tags)
 
static ObjectPtr FromAddr (uword addr)
 
static uword ToAddr (const UntaggedObject *raw_obj)
 
static uword ToAddr (const ObjectPtr raw_obj)
 
static bool IsCanonical (intptr_t value)
 
- Static Public Attributes inherited from dart::UntaggedInstance
static constexpr bool kContainsCompressedPointers = false
 
- Static Public Attributes inherited from dart::UntaggedObject
static constexpr intptr_t kGenerationalBarrierMask = 1 << kNewBit
 
static constexpr intptr_t kIncrementalBarrierMask = 1 << kNotMarkedBit
 
static constexpr intptr_t kBarrierOverlapShift = 2
 
- Static Protected Member Functions inherited from dart::UntaggedObject
template<typename T >
static DART_FORCE_INLINE uword from_offset ()
 
template<typename T >
static DART_FORCE_INLINE uword to_offset (intptr_t length=0)
 
template<>
DART_FORCE_INLINE uword from_offset ()
 
template<>
DART_FORCE_INLINE uword to_offset (intptr_t length)
 
template<>
DART_FORCE_INLINE uword to_offset (intptr_t length)
 
template<>
DART_FORCE_INLINE uword to_offset (intptr_t length)
 
- Protected Attributes inherited from dart::UntaggedPointerBase
uint8_t * data_
 
- Static Protected Attributes inherited from dart::UntaggedObject
static constexpr bool kContainsCompressedPointers = false
 
static constexpr bool kContainsPointerFields = false
 

Detailed Description

Definition at line 3062 of file raw_object.h.

Member Function Documentation

◆ COMPRESSED_SMI_FIELD()

dart::UntaggedTypedDataBase::COMPRESSED_SMI_FIELD ( SmiPtr  ,
length   
)
protected

Friends And Related Symbol Documentation

◆ InitializeExternalTypedData

void InitializeExternalTypedData ( intptr_t  cid,
ExternalTypedDataPtr  from,
ExternalTypedDataPtr  to 
)
friend

Definition at line 301 of file object_graph_copy.cc.

303 {
304 auto raw_from = from.untag();
305 auto raw_to = to.untag();
306 const intptr_t length =
307 TypedData::ElementSizeInBytes(cid) * Smi::Value(raw_from->length_);
308
309 auto buffer = static_cast<uint8_t*>(malloc(length));
310 memmove(buffer, raw_from->data_, length);
311 raw_to->length_ = raw_from->length_;
312 raw_to->data_ = buffer;
313}
intptr_t Value() const
Definition object.h:9969
intptr_t ElementSizeInBytes() const
Definition object.h:11505
static const uint8_t buffer[]
size_t length
void * malloc(size_t size)
Definition allocation.cc:19
const intptr_t cid

◆ InitializeExternalTypedDataWithSafepointChecks

void InitializeExternalTypedDataWithSafepointChecks ( Thread thread,
intptr_t  cid,
const ExternalTypedData from,
const ExternalTypedData to 
)
friend

Definition at line 339 of file object_graph_copy.cc.

343 {
344 const intptr_t length_in_elements = from.Length();
345 const intptr_t length_in_bytes =
346 TypedData::ElementSizeInBytes(cid) * length_in_elements;
347
348 uint8_t* to_data = static_cast<uint8_t*>(malloc(length_in_bytes));
349 to.ptr().untag()->data_ = to_data;
350 to.ptr().untag()->length_ = Smi::New(length_in_elements);
351
352 CopyTypedDataBaseWithSafepointChecks(thread, from, to, length_in_bytes);
353}
static SmiPtr New(intptr_t value)
Definition object.h:9985
friend void CopyTypedDataBaseWithSafepointChecks(Thread *, const T &, const T &, intptr_t)

◆ UntaggedTypedDataView

friend class UntaggedTypedDataView
friend

Definition at line 3074 of file raw_object.h.

◆ UpdateLengthField

void UpdateLengthField ( intptr_t  cid,
ObjectPtr  from,
ObjectPtr  to 
)
friend

Definition at line 280 of file object_graph_copy.cc.

280 {
281 // We share these objects - never copy them.
283
284 // We update any in-heap variable sized object with the length to keep the
285 // length and the size in the object header in-sync for the GC.
286 if (cid == kArrayCid || cid == kImmutableArrayCid) {
287 static_cast<UntaggedArray*>(to.untag())->length_ =
288 static_cast<UntaggedArray*>(from.untag())->length_;
289 } else if (cid == kContextCid) {
290 static_cast<UntaggedContext*>(to.untag())->num_variables_ =
291 static_cast<UntaggedContext*>(from.untag())->num_variables_;
292 } else if (IsTypedDataClassId(cid)) {
293 static_cast<UntaggedTypedDataBase*>(to.untag())->length_ =
294 static_cast<UntaggedTypedDataBase*>(from.untag())->length_;
295 } else if (cid == kRecordCid) {
296 static_cast<UntaggedRecord*>(to.untag())->shape_ =
297 static_cast<UntaggedRecord*>(from.untag())->shape_;
298 }
299}
#define ASSERT(E)
bool IsTypedDataClassId(intptr_t index)
Definition class_id.h:433
bool IsStringClassId(intptr_t index)
Definition class_id.h:350

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