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

Public Member Functions

 ArrayMessageDeserializationCluster (bool is_canonical, intptr_t cid)
 
 ~ArrayMessageDeserializationCluster ()
 
void ReadNodes (MessageDeserializer *d)
 
void ReadEdges (MessageDeserializer *d)
 
ObjectPtr PostLoad (MessageDeserializer *d)
 
void ReadNodesApi (ApiMessageDeserializer *d)
 
void ReadEdgesApi (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 2390 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ ArrayMessageDeserializationCluster()

dart::ArrayMessageDeserializationCluster::ArrayMessageDeserializationCluster ( bool  is_canonical,
intptr_t  cid 
)
inlineexplicit

Definition at line 2393 of file message_snapshot.cc.

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

◆ ~ArrayMessageDeserializationCluster()

dart::ArrayMessageDeserializationCluster::~ArrayMessageDeserializationCluster ( )
inline

Definition at line 2395 of file message_snapshot.cc.

2395{}

Member Function Documentation

◆ PostLoad()

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

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 2417 of file message_snapshot.cc.

2417 {
2418 if (is_canonical()) {
2419 SafepointMutexLocker ml(
2420 d->isolate_group()->constant_canonicalization_mutex());
2421 Instance& instance = Instance::Handle(d->zone());
2422 for (intptr_t i = start_index_; i < stop_index_; i++) {
2423 instance ^= d->Ref(i);
2424 instance = instance.CanonicalizeLocked(d->thread());
2425 d->UpdateRef(i, instance);
2426 }
2427 }
2428 return nullptr;
2429 }
static Object & Handle()
Definition: object.h:407
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
VkInstance instance
Definition: main.cc:48

◆ ReadEdges()

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

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 2405 of file message_snapshot.cc.

2405 {
2406 for (intptr_t id = start_index_; id < stop_index_; id++) {
2407 ArrayPtr array = static_cast<ArrayPtr>(d->Ref(id));
2408 intptr_t length = Smi::Value(array->untag()->length());
2409 array->untag()->set_type_arguments(
2410 static_cast<TypeArgumentsPtr>(d->ReadRef()));
2411 for (intptr_t j = 0; j < length; j++) {
2412 array->untag()->set_element(j, d->ReadRef());
2413 }
2414 }
2415 }
intptr_t Value() const
Definition: object.h:9990
size_t length

◆ ReadEdgesApi()

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

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 2446 of file message_snapshot.cc.

2446 {
2447 for (intptr_t id = start_index_; id < stop_index_; id++) {
2448 Dart_CObject* array = d->Ref(id);
2449 intptr_t length = array->value.as_array.length;
2450 d->ReadRef(); // type_arguments
2451 for (intptr_t i = 0; i < length; i++) {
2452 array->value.as_array.values[i] = d->ReadRef();
2453 }
2454 }
2455 }
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@89 as_array
struct _Dart_CObject ** values

◆ ReadNodes()

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

Implements dart::MessageDeserializationCluster.

Definition at line 2397 of file message_snapshot.cc.

2397 {
2398 const intptr_t count = d->ReadUnsigned();
2399 for (intptr_t i = 0; i < count; i++) {
2400 intptr_t length = d->ReadUnsigned();
2401 d->AssignRef(Array::NewUninitialized(cid_, length));
2402 }
2403 }
int count
Definition: FontMgrTest.cpp:50
static ArrayPtr NewUninitialized(intptr_t len, Heap::Space space=Heap::kNew)
Definition: object.h:10964

◆ ReadNodesApi()

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

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 2431 of file message_snapshot.cc.

2431 {
2432 intptr_t count = d->ReadUnsigned();
2433 for (intptr_t i = 0; i < count; i++) {
2434 Dart_CObject* array = d->Allocate(Dart_CObject_kArray);
2435 intptr_t length = d->ReadUnsigned();
2436 array->value.as_array.length = length;
2437 if (length == 0) {
2438 array->value.as_array.values = nullptr;
2439 } else {
2440 array->value.as_array.values = d->zone()->Alloc<Dart_CObject*>(length);
2441 }
2442 d->AssignRef(array);
2443 }
2444 }
@ Dart_CObject_kArray

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