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

Public Member Functions

 OneByteStringMessageDeserializationCluster (bool is_canonical)
 
 ~OneByteStringMessageDeserializationCluster ()
 
void ReadNodes (MessageDeserializer *d)
 
void ReadNodesApi (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 2523 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ OneByteStringMessageDeserializationCluster()

dart::OneByteStringMessageDeserializationCluster::OneByteStringMessageDeserializationCluster ( bool  is_canonical)
inlineexplicit

Definition at line 2526 of file message_snapshot.cc.

2527 : MessageDeserializationCluster("OneByteString", is_canonical) {}
MessageDeserializationCluster(const char *name, bool is_canonical=false)

◆ ~OneByteStringMessageDeserializationCluster()

dart::OneByteStringMessageDeserializationCluster::~OneByteStringMessageDeserializationCluster ( )
inline

Definition at line 2528 of file message_snapshot.cc.

2528{}

Member Function Documentation

◆ ReadNodes()

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

Implements dart::MessageDeserializationCluster.

Definition at line 2530 of file message_snapshot.cc.

2530 {
2531 const intptr_t count = d->ReadUnsigned();
2532 for (intptr_t i = 0; i < count; i++) {
2533 intptr_t length = d->ReadUnsigned();
2534 const uint8_t* data = d->CurrentBufferAddress();
2535 d->Advance(length * sizeof(uint8_t));
2536 d->AssignRef(is_canonical()
2537 ? Symbols::FromLatin1(d->thread(), data, length)
2539 }
2540 }
int count
Definition: FontMgrTest.cpp:50
static StringPtr FromLatin1(const uint8_t *latin1_array, intptr_t array_len, Heap::Space space=Heap::kNew)
Definition: object.cc:23733
static StringPtr FromLatin1(Thread *thread, const uint8_t *latin1_array, intptr_t len)
Definition: symbols.cc:223
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
size_t length
static int8_t data[kExtLength]

◆ ReadNodesApi()

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

Reimplemented from dart::MessageDeserializationCluster.

Definition at line 2542 of file message_snapshot.cc.

2542 {
2543 intptr_t count = d->ReadUnsigned();
2544 for (intptr_t i = 0; i < count; i++) {
2545 Dart_CObject* str = d->Allocate(Dart_CObject_kString);
2546 intptr_t latin1_length = d->ReadUnsigned();
2547 const uint8_t* data = d->CurrentBufferAddress();
2548
2549 d->Advance(latin1_length * sizeof(uint8_t));
2550
2551 intptr_t utf8_len = 0;
2552 for (intptr_t i = 0; i < latin1_length; i++) {
2553 utf8_len += Utf8::Length(data[i]);
2554 }
2555 char* utf8_data = d->zone()->Alloc<char>(utf8_len + 1);
2556 str->value.as_string = utf8_data;
2557 for (intptr_t i = 0; i < latin1_length; i++) {
2558 utf8_data += Utf8::Encode(data[i], utf8_data);
2559 }
2560 *utf8_data = '\0';
2561
2562 d->AssignRef(str);
2563 }
2564 }
static intptr_t Length(int32_t ch)
Definition: unicode.cc:98
static intptr_t Encode(int32_t ch, char *dst)
Definition: unicode.cc:110
@ Dart_CObject_kString
union _Dart_CObject::@86 value
const char * as_string

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