Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
dart::TypedDataViewMessageDeserializationCluster Class Reference
Inheritance diagram for dart::TypedDataViewMessageDeserializationCluster:
dart::MessageDeserializationCluster dart::ZoneAllocated

Classes

struct  Dart_CTypedDataView
 

Public Member Functions

 TypedDataViewMessageDeserializationCluster (intptr_t cid)
 
 ~TypedDataViewMessageDeserializationCluster ()
 
void ReadNodes (MessageDeserializer *d)
 
void ReadEdges (MessageDeserializer *d)
 
ObjectPtr PostLoad (MessageDeserializer *d)
 
void ReadNodesApi (ApiMessageDeserializer *d)
 
void ReadEdgesApi (ApiMessageDeserializer *d)
 
void PostLoadApi (ApiMessageDeserializer *d)
 
- Public Member Functions inherited from dart::MessageDeserializationCluster
 MessageDeserializationCluster (const char *name, bool is_canonical=false)
 
virtual ~MessageDeserializationCluster ()
 
virtual void ReadNodes (MessageDeserializer *d)=0
 
virtual void ReadEdges (MessageDeserializer *d)
 
virtual ObjectPtr PostLoad (MessageDeserializer *d)
 
virtual void ReadNodesApi (ApiMessageDeserializer *d)
 
virtual void ReadEdgesApi (ApiMessageDeserializer *d)
 
virtual void PostLoadApi (ApiMessageDeserializer *d)
 
void ReadNodesWrapped (MessageDeserializer *d)
 
void ReadNodesWrappedApi (ApiMessageDeserializer *d)
 
const char * name () const
 
bool is_canonical () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::MessageDeserializationCluster
ObjectPtr PostLoadAbstractType (MessageDeserializer *d)
 
ObjectPtr PostLoadLinkedHash (MessageDeserializer *d)
 
 DISALLOW_COPY_AND_ASSIGN (MessageDeserializationCluster)
 
- Protected Attributes inherited from dart::MessageDeserializationCluster
const char *const name_
 
const bool is_canonical_
 
intptr_t start_index_
 
intptr_t stop_index_
 

Detailed Description

Definition at line 1570 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ TypedDataViewMessageDeserializationCluster()

dart::TypedDataViewMessageDeserializationCluster::TypedDataViewMessageDeserializationCluster ( intptr_t  cid)
inlineexplicit

Definition at line 1573 of file message_snapshot.cc.

1574 : MessageDeserializationCluster("TypedDataView"), cid_(cid) {}
MessageDeserializationCluster(const char *name, bool is_canonical=false)
const intptr_t cid

◆ ~TypedDataViewMessageDeserializationCluster()

dart::TypedDataViewMessageDeserializationCluster::~TypedDataViewMessageDeserializationCluster ( )
inline

Definition at line 1575 of file message_snapshot.cc.

1575{}

Member Function Documentation

◆ PostLoad()

ObjectPtr dart::TypedDataViewMessageDeserializationCluster::PostLoad ( MessageDeserializer d)
inlinevirtual

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 1621 of file message_snapshot.cc.

1621 {
1622 if (format_ == kTypedDataViewFromC) return nullptr;
1623 for (intptr_t id = start_index_; id < stop_index_; id++) {
1624 TypedDataViewPtr view = static_cast<TypedDataViewPtr>(d->Ref(id));
1625 view->untag()->RecomputeDataField();
1626 }
1627 return nullptr;
1628 }
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
@ kTypedDataViewFromC

◆ PostLoadApi()

void dart::TypedDataViewMessageDeserializationCluster::PostLoadApi ( ApiMessageDeserializer d)
inlinevirtual

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 1715 of file message_snapshot.cc.

1715 {
1716 if (format_ == kTypedDataViewFromC) return;
1718 switch (cid_) {
1719 case kTypedDataInt8ArrayViewCid:
1720 case kUnmodifiableTypedDataInt8ArrayViewCid:
1722 break;
1723 case kTypedDataUint8ArrayViewCid:
1724 case kUnmodifiableTypedDataUint8ArrayViewCid:
1726 break;
1727 case kTypedDataUint8ClampedArrayViewCid:
1728 case kUnmodifiableTypedDataUint8ClampedArrayViewCid:
1730 break;
1731 case kTypedDataInt16ArrayViewCid:
1732 case kUnmodifiableTypedDataInt16ArrayViewCid:
1734 break;
1735 case kTypedDataUint16ArrayViewCid:
1736 case kUnmodifiableTypedDataUint16ArrayViewCid:
1738 break;
1739 case kTypedDataInt32ArrayViewCid:
1740 case kUnmodifiableTypedDataInt32ArrayViewCid:
1742 break;
1743 case kTypedDataUint32ArrayViewCid:
1744 case kUnmodifiableTypedDataUint32ArrayViewCid:
1746 break;
1747 case kTypedDataInt64ArrayViewCid:
1748 case kUnmodifiableTypedDataInt64ArrayViewCid:
1750 break;
1751 case kTypedDataUint64ArrayViewCid:
1752 case kUnmodifiableTypedDataUint64ArrayViewCid:
1754 break;
1755 case kTypedDataFloat32ArrayViewCid:
1756 case kUnmodifiableTypedDataFloat32ArrayViewCid:
1758 break;
1759 case kTypedDataFloat64ArrayViewCid:
1760 case kUnmodifiableTypedDataFloat64ArrayViewCid:
1762 break;
1763 case kTypedDataInt32x4ArrayViewCid:
1764 case kUnmodifiableTypedDataInt32x4ArrayViewCid:
1766 break;
1767 case kTypedDataFloat32x4ArrayViewCid:
1768 case kUnmodifiableTypedDataFloat32x4ArrayViewCid:
1770 break;
1771 case kTypedDataFloat64x2ArrayViewCid:
1772 case kUnmodifiableTypedDataFloat64x2ArrayViewCid:
1774 break;
1775 default:
1776 UNREACHABLE();
1777 }
1778
1779 for (intptr_t id = start_index_; id < stop_index_; id++) {
1780 Dart_CTypedDataView* view = static_cast<Dart_CTypedDataView*>(d->Ref(id));
1781 if (view->typed_data->type == Dart_CObject_kTypedData) {
1782 view->type = Dart_CObject_kTypedData;
1783 view->value.as_typed_data.type = type;
1784 view->value.as_typed_data.length = view->length->value.as_int32;
1785 view->value.as_typed_data.values =
1786 view->typed_data->value.as_typed_data.values +
1787 view->offset_in_bytes->value.as_int32;
1788 } else {
1789 UNREACHABLE();
1790 }
1791 }
1792 }
#define UNREACHABLE()
Definition: assert.h:248
GLenum type
Dart_TypedData_Type
Definition: dart_api.h:2612
@ Dart_TypedData_kFloat32x4
Definition: dart_api.h:2626
@ Dart_TypedData_kInt32x4
Definition: dart_api.h:2625
@ Dart_TypedData_kUint8
Definition: dart_api.h:2615
@ Dart_TypedData_kUint32
Definition: dart_api.h:2620
@ Dart_TypedData_kInt32
Definition: dart_api.h:2619
@ Dart_TypedData_kUint16
Definition: dart_api.h:2618
@ Dart_TypedData_kFloat64x2
Definition: dart_api.h:2627
@ Dart_TypedData_kUint64
Definition: dart_api.h:2622
@ Dart_TypedData_kFloat32
Definition: dart_api.h:2623
@ Dart_TypedData_kInt16
Definition: dart_api.h:2617
@ Dart_TypedData_kFloat64
Definition: dart_api.h:2624
@ Dart_TypedData_kUint8Clamped
Definition: dart_api.h:2616
@ Dart_TypedData_kInt8
Definition: dart_api.h:2614
@ Dart_TypedData_kInt64
Definition: dart_api.h:2621
@ Dart_CObject_kTypedData

◆ ReadEdges()

void dart::TypedDataViewMessageDeserializationCluster::ReadEdges ( MessageDeserializer d)
inlinevirtual

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 1610 of file message_snapshot.cc.

1610 {
1611 if (format_ == kTypedDataViewFromC) return;
1612 for (intptr_t id = start_index_; id < stop_index_; id++) {
1613 TypedDataViewPtr view = static_cast<TypedDataViewPtr>(d->Ref(id));
1614 view->untag()->set_length(static_cast<SmiPtr>(d->ReadRef()));
1615 view->untag()->set_typed_data(
1616 static_cast<TypedDataBasePtr>(d->ReadRef()));
1617 view->untag()->set_offset_in_bytes(static_cast<SmiPtr>(d->ReadRef()));
1618 }
1619 }

◆ ReadEdgesApi()

void dart::TypedDataViewMessageDeserializationCluster::ReadEdgesApi ( ApiMessageDeserializer d)
inlinevirtual

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 1705 of file message_snapshot.cc.

1705 {
1706 if (format_ == kTypedDataViewFromC) return;
1707 for (intptr_t id = start_index_; id < stop_index_; id++) {
1708 Dart_CTypedDataView* view = static_cast<Dart_CTypedDataView*>(d->Ref(id));
1709 view->length = d->ReadRef();
1710 view->typed_data = d->ReadRef();
1711 view->offset_in_bytes = d->ReadRef();
1712 }
1713 }

◆ ReadNodes()

void dart::TypedDataViewMessageDeserializationCluster::ReadNodes ( MessageDeserializer d)
inlinevirtual

Implements dart::MessageDeserializationCluster.

Definition at line 1577 of file message_snapshot.cc.

1577 {
1578 const intptr_t count = d->ReadUnsigned();
1579 format_ = d->Read<TypedDataViewFormat>();
1580 if (format_ == kTypedDataViewFromC) {
1581 intptr_t view_cid = cid_;
1583 intptr_t backing_cid = cid_ - kTypedDataCidRemainderUnmodifiable +
1585 ASSERT(IsExternalTypedDataClassId(backing_cid));
1586 intptr_t element_size =
1588 ExternalTypedData& data = ExternalTypedData::Handle(d->zone());
1589 TypedDataView& view = TypedDataView::Handle(d->zone());
1590 for (intptr_t i = 0; i < count; i++) {
1591 intptr_t length = d->ReadUnsigned();
1592 FinalizableData finalizable_data = d->finalizable_data()->Take();
1594 backing_cid, reinterpret_cast<uint8_t*>(finalizable_data.data),
1595 length);
1596 data.SetImmutable(); // Can pass by reference.
1597 intptr_t external_size = length * element_size;
1598 data.AddFinalizer(finalizable_data.peer, finalizable_data.callback,
1599 external_size);
1600 view = TypedDataView::New(view_cid, data, 0, length);
1601 d->AssignRef(data.ptr());
1602 }
1603 } else {
1604 for (intptr_t i = 0; i < count; i++) {
1605 d->AssignRef(TypedDataView::New(cid_));
1606 }
1607 }
1608 }
int count
Definition: FontMgrTest.cpp:50
static size_t element_size(Layout layout, SkSLType type)
static ExternalTypedDataPtr New(intptr_t class_id, uint8_t *data, intptr_t len, Heap::Space space=Heap::kNew, bool perform_eager_msan_initialization_check=true)
Definition: object.cc:25626
static Object & Handle()
Definition: object.h:407
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
static TypedDataViewPtr New(intptr_t class_id, Heap::Space space=Heap::kNew)
Definition: object.cc:25658
#define ASSERT(E)
size_t length
const int kTypedDataCidRemainderUnmodifiable
Definition: class_id.h:264
bool IsUnmodifiableTypedDataViewClassId(intptr_t index)
Definition: class_id.h:453
const int kTypedDataCidRemainderExternal
Definition: class_id.h:263
static int8_t data[kExtLength]
bool IsExternalTypedDataClassId(intptr_t index)
Definition: class_id.h:447

◆ ReadNodesApi()

void dart::TypedDataViewMessageDeserializationCluster::ReadNodesApi ( ApiMessageDeserializer d)
inlinevirtual

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 1636 of file message_snapshot.cc.

1636 {
1637 intptr_t count = d->ReadUnsigned();
1638 format_ = d->Read<TypedDataViewFormat>();
1639 if (format_ == kTypedDataViewFromC) {
1641 switch (cid_) {
1642 case kUnmodifiableTypedDataInt8ArrayViewCid:
1644 break;
1645 case kUnmodifiableTypedDataUint8ArrayViewCid:
1647 break;
1648 case kUnmodifiableTypedDataUint8ClampedArrayViewCid:
1650 break;
1651 case kUnmodifiableTypedDataInt16ArrayViewCid:
1653 break;
1654 case kUnmodifiableTypedDataUint16ArrayViewCid:
1656 break;
1657 case kUnmodifiableTypedDataInt32ArrayViewCid:
1659 break;
1660 case kUnmodifiableTypedDataUint32ArrayViewCid:
1662 break;
1663 case kUnmodifiableTypedDataInt64ArrayViewCid:
1665 break;
1666 case kUnmodifiableTypedDataUint64ArrayViewCid:
1668 break;
1669 case kUnmodifiableTypedDataFloat32ArrayViewCid:
1671 break;
1672 case kUnmodifiableTypedDataFloat64ArrayViewCid:
1674 break;
1675 case kUnmodifiableTypedDataInt32x4ArrayViewCid:
1677 break;
1678 case kUnmodifiableTypedDataFloat32x4ArrayViewCid:
1680 break;
1681 case kUnmodifiableTypedDataFloat64x2ArrayViewCid:
1683 break;
1684 default:
1685 UNREACHABLE();
1686 }
1687
1690 intptr_t length = d->ReadUnsigned();
1691 FinalizableData finalizable_data = d->finalizable_data()->Get();
1692 data->value.as_typed_data.type = type;
1693 data->value.as_typed_data.length = length;
1694 data->value.as_typed_data.values =
1695 reinterpret_cast<uint8_t*>(finalizable_data.data);
1696 d->AssignRef(data);
1697 } else {
1698 for (intptr_t i = 0; i < count; i++) {
1699 Dart_CTypedDataView* view = d->zone()->Alloc<Dart_CTypedDataView>(1);
1700 d->AssignRef(view);
1701 }
1702 }
1703 }
@ Dart_CObject_kUnmodifiableExternalTypedData

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